Tuesday 5 March 2019

Use of symbols in custom directives and Components Scope Binding in angular 1

< is for one-way binding.
@ binding is for passing strings. These strings support {{}} expressions for interpolated values.
= binding is for two-way model binding. The model in parent scope is linked to the model in the directive's isolated scope.
& binding is for passing a method into your directive's scope so that it can be called within your directive.
When we are setting scope: true in directive, Angular js will create a new scope for that directive. That means any changes made to the directive scope will not reflect back in parent controller.

<: one-way binding
=: two-way binding
&: function binding
@: pass only strings

No comments:

Post a Comment