β

看了解AngularJs的指令中的@,=

小红博客 51 阅读

Attribute Isolated Scope

Defined with an @ symbol Binds a local scope property to the value of a DOM attribute The binding is uni-directional from parent to directive The result is always a string because DOM attributes are strings

images

Binding Isolated Scope

Defined with an = symbol Bi-directional binding between parent and directive You can define the binding as optional via =? Optimal for dealing with objects and collections

images

Expression Isolated Scope

Defined using an & symbol Allows you to execute an expression on the parent scope To pass variables from child to parent expressions you must use an object map

images

作者:小红博客
原文地址:看了解AngularJs的指令中的@,=, 感谢原作者分享。

发表评论