Recently I discovered that every directive in AngularJS has a priority score assigned to it. While the page is loaded the priority plays a very important role in setting the order of the execution of various directives in single DOM Element. The priority is used to sort the directives before their “compile” function gets called. […]
In Directives there is one more attribute named : “require” , which gives us the liberty to include another directive and inject its controller as the fourth argument to the linking function. It accept both string as well as array type. In case of array, the controllers are included in the given order. There are some prefixes, when applied before controller name, provides different functionality.
In simple words transclusion is the ability to wrap user’s markup by our own template(markup). Lets say we are creating some component in which the user can hack in his own markup with his own scope variables and values. The markup they provide will co-exist in the component we wrote!
AngularJSFront End Development
In this post we will go through an important aspect of AngularJS i.e., Directives. Directives helps us do things in a better and cleaner way. Lets get into the code rather going into theoretical explanations, which will make it more clear what actually directives do. We have written a simple directive below which shows some HTML when […]