Directive Definition Object (DDO)

John Lindquist
InstructorJohn Lindquist
Share this video with your friends

Social Share Links

Send Tweet
Published 10 years ago
Updated 6 years ago

Directive Definition Objects are used to configure AngularJS directives. Be sure to check out our Directive Definition Object Cheat Sheet.

Man 1: [00:00] This function that we just set up is what's called a link function, and it's actually a very small part of a larger API. If I cut this and instead I return an object and it has a property of link with that function, you'll see that this will behave the exact same way. Now this object that we are returning here is called the directive definition object, or DDO if you want an acronym for it. There's plenty of things on here for you to configure.

[00:32] I want to emphasize that the things on here such as restrict, such as template, such as templateURL, and priority, and all the other things you can put on here are really a matter of configuration. A lot of the things you'll just have to get used to, you'll memorize what you put in there. It's not a lot of writing code. When it comes to writing code a lot of it ends up in either this link function or a controller function which we'll talk about later, and in rare scenarios, when you need to use it, a compile function. But the rest of it such as restrict and other is basically configuration which you just really have to memorize.

[01:13] You'll be referring to the docs or these reference videos as you write your directive definition object.

egghead
egghead
~ 26 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today