AngularJS 1.4.1 和 angular UI bootstrap 0.13.0,ng-class 对象 属性

AngularJS 1.4.1 and angular UI bootstrap 0.13.0, ng-class with object property

我有以下代码,

<accordion-group ng-class={selected : object.property}></accordion-group>
<input type="button" ng-click="object.property=!object.property">

当我 运行 上面的代码时,在加载应用程序时,object.property 为真并应用 css。单击按钮后,css 属性 将被删除。再次单击按钮时,css 不会被应用。

注意:这适用于 angular 和 bootstrap 的早期版本。我最近升级到 angular1.4.1 和 bootstrap 0.13.0。我怀疑这是因为最新的版本更新,但是找不到有效的文档供我总结。

提前致谢。

<input type="button" ng-click="object.property = !object.property">

而且我更喜欢这样 ng-class:

ng-class="{'selected' : property}"

因为:运算符的左边肯定会有一个字符串!

这里是 PLNKR.