To bind the value in $scope in ng-bind, you need to write {{}}
To bind the value in $scope in ng-src, you need to write {{}}
You don’t need to write {{}}
to determine true or false in ng-checked. In ng-class, you need to write {}
When do you need {{}} and when do you need {}? Are there any rules for this?
You remember one thing, as long as it is
ng-
开关的指令,大都是不需要写的。ng-src
except.ng-src
为什么要呢?主要是因为不能直接用src
,它会直接请求,不等待 Angular 解析{{}}
,而ng-src
Mainly to achieve effects similar to this:So, that’s it.
ng-class
实际上是需要你提供一个对象,所以使用{}
to construct.