练习angularjs的ng-click的应用
angular的click事件ng-click。
实现一个小功能计数器,用户可以点击“+”或“-”铵钮,数值每随点击铵钮增长1或减1。使用ng-init设置初始值为0。
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
<div ng-app="" ng-init="Count = 0"> <button ng-click="Count = Count + 1"> + </button> <button ng-click="Count = Count - 1"> - </button> <div> </div> <div> Result: {{Count}} </div> </div> @Scripts.Render("~/bundles/angular")