Well, say you have controller.js and view.html with the following code:
$scope.name = 'world';
<div a="name" b="{{name}}">
Now, you have two different directives:
// boilerplate directive stuff
scope: {
name: '@'
}
// more boilderplate directive stuff
- '@' means copy the attr value.
- "a" -> "name" (because that is what the value of the "a" attribute is)
- "b" -> "world" (because it would be interpolated)
// boilerplate directive stuff
scope: {
name: '='
}
// more boilerplate directive stuff
- "=" means evaluate the expression
- "a" -> "world" (we are treating "name" as expression and it is "world")
- "b" -> ERROR. Because "{{name}}" is not a valid expression