3

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?

Erik Philips
  • 53,428
  • 11
  • 128
  • 150
Vikram
  • 622
  • 1
  • 6
  • 18
  • One-way `<` binding was added with AngularJS V1.5. See [AngularJS commit feat($compile): add one-way binding to the isolate scope definition](https://github.com/angular/angular.js/commit/4ac23c0ac59c269d65b7f78efec75d060121bd18) – georgeawg Apr 25 '17 at 14:12
  • The Developer Guide section that you quoted is dated. For a more up-to-date guide to isolate scope, see [AngularJS Developer Guide - Component Based Application Architecture](https://docs.angularjs.org/guide/component#component-based-application-architecture) – georgeawg Apr 25 '17 at 14:23

3 Answers3

5

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.

Karim
  • 8,454
  • 3
  • 25
  • 33
2

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

Manikandan Velayutham
  • 2,228
  • 1
  • 15
  • 22
0

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)