@@ -37,7 +37,7 @@ would be lost, because the browser ignores the attribute value.
37
37
In the following example, the interpolation information would be ignored and the browser would simply
38
38
interpret the attribute as present, meaning that the button would always be disabled.
39
39
40
- ```html
40
+ ```html
41
41
Disabled: <input type="checkbox" ng-model="isDisabled" />
42
42
<button disabled="{{isDisabled}}">Disabled</button>
43
43
```
@@ -49,7 +49,7 @@ For this reason, Angular provides special `ng`-prefixed directives for the follo
49
49
These directives take an expression inside the attribute, and set the corresponding boolean attribute
50
50
to true when the expression evaluates to truthy.
51
51
52
- ```html
52
+ ```html
53
53
Disabled: <input type="checkbox" ng-model="isDisabled" />
54
54
<button ng-disabled="isDisabled">Disabled</button>
55
55
```
@@ -144,3 +144,14 @@ interpolation markup and not data.
144
144
- It impacts performance, as interpolation adds another watcher to the scope.
145
145
- Since this is not recommended usage, we do not test for this, and changes to
146
146
Angular core may break your code.
147
+
148
+ ## Known Issues
149
+
150
+ You should avoid dynamically changing the content of an interpolated string (e.g. attribute value
151
+ or text node). Your changes are likely to be overwriten, when the original string gets evaluated.
152
+ This restriction applies to both directly changing the content via JavaScript or indirectly using a
153
+ directive.
154
+
155
+ For example, you should not use interpolation in the value of the `style` attribute (e.g.
156
+ `style="color: {{ 'orange' }}; font-weight: {{ 'bold' }};"`) **and** at the same time use a
157
+ directive that changes the content of that attributte, such as `ngStyle`.
0 commit comments