为什么在使用 ng-if 时第二个按钮不起作用?
我想实现一个按钮,该按钮仅在设置模型值时出现/不是“”/不为空。
模板:
<input type="text" ng-model="blub"/>
<br/>
<button ng-click="blub = 'xxxx'">X</button>
<br/>
<button ng-click="blub = 'yyyy'" ng-if="blub.length">Y</button>
Controller :
angular.module('test', [])
.controller('Main', function ($scope) {
// nothing to do here
});
玩转: JSFiddle
最佳答案
关于javascript - ng-click 不适用于 ng-if,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27039631/