Bartos Gergely

11th Apr

The scope of directives in AngularJS

Monday, April 11, 2016 - 11:55
Author: Bartos Gergely
DirectivesDirectives are very powerful features of AngularJS. Imagine them as building re-usable components of any AngularJS application.The scopeEvery directive has a scope associated with it which is used for accessing data/methods inside the template and link function. Scope by default inherits from its parent scope, but this may not be desirable behavior, especially if you are building a re-usable widget.You can change the default scope of directives by passing a configuration object known as directive definition object. A directive definition object (DDO) is a simple JavaScript object