What is the default scope value of an AngularJS directive?
Of course, it is not isolated scope. It is true or false.
I can't find any documentation on what it is.
Locals definition is a hash of local scope property to its source: = or =attr - set up bi-directional binding between a local scope property and the parent scope property of name defined via the value of the attr attribute.
AngularJS directives are extended HTML attributes with the prefix ng- . The ng-app directive initializes an AngularJS application. The ng-init directive initializes application data. The ng-model directive binds the value of HTML controls (input, select, textarea) to application data.
AngularJS Scope The scope is the binding part between the HTML (view) and the JavaScript (controller). The scope is an object with the available properties and methods. The scope is available for both the view and the controller.
"Note, by default, directives do not create new scope -- i.e., the default is
scope: false
"
from Understanding scopes.
Using the scope option in directive you can:
scope: true
scope: {}
then you can bind some property to parent scopes with '@', '&', '='
(see this question).scope: false
(default).If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With