Isolated scope binding types

770 views Asked by At

According to AngularJS Developer Guide - Directives "Isolating the Scope of a Directive", scope binding can be done in 3 types

=, @ and &

and

according to "Directive Definition Object" section in this Page, scope binding can be done in 4 types

=, @, & and <

Even in most of the online articles isolated scope binding is given of 3 types only.

Which is correct?

3

There are 3 answers

0
AudioBubble On

i think there is 3 types:

the = for a bidirectional binding (for ex Parent Directive share a property with its child)

the @ for one direction binding (for ex Parent Directive send a params to its child)

the & for function binding (for ex a child can call a function declared in the scope of his Parent Directive)

0
Karim On

these are the standard bindings before angular 1.5

=, @ and &

from angular 1.5 onwards with the new concept of component based architecture it has been introduced this binding

<

that represents a single way binding.

0
Manikandan Velayutham On

We are create custom directive by using =, @ and &.

Later angular 1.5 : Angularjs introduced Component is a special kind of directive that uses a simpler configuration which is suitable for a component-based application structure.

The < symbol denotes one-way bindings which are available since 1.5. The difference to = is that the bound properties in the component scope are not watched, which means if you assign a new value to the property in the component scope, it will not update the parent scope.

https://docs.angularjs.org/guide/component