How to disable a button in ANGULARJS

后端 未结 4 1475
没有蜡笔的小新
没有蜡笔的小新 2020-12-17 19:56

i have angularJS 1.5.0-rc.2

I found on the internet that i can use the directive

data-ng-disabled=\"Expression\"

But it won\'t dis

4条回答
  •  庸人自扰
    2020-12-17 20:42

    I make it without derective. I made it like this:

    remove
    

    In controller first of all made

    $scope.disabled = true;
    

    Than in if/else remove class disabled and change $scope.disabled = false;

    I give you example with tag this work with button simple.

    And in button ng-click first made Test ng-click="disabled||usertaskctrl.removeTasksToArchive()" before make click on some you function.

提交回复
热议问题