[英]How to toggle class name with ng-click
I want that each click on .clickClass
would affect toggle .foo
on .present
class - 我想这对每次点击.clickClass
会拨动影响.foo
上.present
类-
mean - 意思 -
init - present
, 初始化present
1st click present foo
第一次点击present foo
2nd click present
第2点击present
and so on ... 等等 ...
so far I have - 到目前为止,我有-
<div class="clickClass" ng-click="className= 'foo'"></div>
<div class="present {{className}}"></div>
http://jsfiddle.net/urielz/qQdn7/1/ http://jsfiddle.net/urielz/qQdn7/1/
How to get that ? 如何获得?
Update : 更新:
Here is sample works - http://plnkr.co/edit/0lu6x8uP7nVcTTYaNj4o?p=preview 这是示例作品-http://plnkr.co/edit/0lu6x8uP7nVcTTYaNj4o?p=preview
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.