1. "@" ( Text binding / one-way binding )
2. "=" ( Direct model binding / two-way binding )
3. "&" ( Behaviour binding / Method binding )
4. "=?" ( Optional model binding, outer scope does not have to have the corresponding scope variable )
5. "@", then add observe/watch in the directive ( Text / one-way binding, but will update inner scope whenever the value changes, as opposed to passing it into directive like a parameter once )
http://www.undefinednull.com/2014/02/11/mastering-the-scope-of-a-directive-in-angularjs/
Sharing my thoughts on software development
Thursday, June 5, 2014
Angular Directive Isolated Scope binding cheatsheet
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment