简体   繁体   中英

angularJs ng-disabled not working

{
    $scope.editable = true;
    $scope.NewEmployee = function () {
        $scope.editable = false;
    };

    $scope.EditEmployee = function () {
        $scope.editable = false;
        $scope.Employee.edit = true;
    };

    $scope.Cancel = function () {
        $scope.editable = true;
    };
}

<button ng-click="NewEmployee()"></button>
<button ng-click="EditEmployee()" ></button>
<button ng-click="Save()" ng-disabled="editable"></button>
<button ng-class="Cancel()" ng-disabled="editable"></button>

when there is only NewEmployee() it's work

but I add EditEmployee() Save() Cancel() one of these it's not work

There is a TYPO error in your code

<button ng-class="Cancel()" ng-disabled="editable"></button>

ng-class="Cancel()" this should be like ng-click="Cancel()"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM