Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Isolated scope binding types

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?

like image 332
Vikram Avatar asked Oct 15 '25 19:10

Vikram


2 Answers

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.

like image 159
Karim Avatar answered Oct 18 '25 12:10

Karim


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

like image 39
Manikandan Velayutham Avatar answered Oct 18 '25 13:10

Manikandan Velayutham