isolated-scope

AngularJS : Differences among = & @ in directive scope? [duplicate]

不羁岁月 提交于 2019-12-17 14:59:23
问题 This question already has answers here : What is the difference between '@' and '=' in directive scope in AngularJS? (18 answers) Closed 5 years ago . Creating an isolate scope inside a directive lets us map the outer scope to the inner scope . We have seen six different ways to map to attrbutes: =attr &attr @attr = & @ What do each of these scope mapping options do? 回答1: This can be confusing but hopefully a simple example will clarify it. First, let's separate model bindings from behaviors.

AngularJS : Differences among = & @ in directive scope? [duplicate]

浪子不回头ぞ 提交于 2019-11-27 16:37:15
This question already has an answer here: What is the difference between '@' and '=' in directive scope in AngularJS? 18 answers Creating an isolate scope inside a directive lets us map the outer scope to the inner scope . We have seen six different ways to map to attrbutes: =attr &attr @attr = & @ What do each of these scope mapping options do? This can be confusing but hopefully a simple example will clarify it. First, let's separate model bindings from behaviors. Here is a fiddle that should help tie things together: http://jsfiddle.net/jeremylikness/3pvte/ And explained ... if your

What is the difference between '@' and '=' in directive scope in AngularJS?

假装没事ソ 提交于 2019-11-25 21:46:48
问题 I\'ve read the AngularJS documentation on the topic carefully, and then fiddled around with a directive. Here\'s the fiddle. And here are some relevant snippets: From the HTML: <pane bi-title=\"title\" title=\"{{title}}\">{{text}}</pane> From the pane directive: scope: { biTitle: \'=\', title: \'@\', bar: \'=\' }, There are several things I don\'t get: Why do I have to use \"{{title}}\" with \'@\' and \"title\" with \'=\' ? Can I also access the parent scope directly, without decorating my