javascript - angular ng-disable not working as expected -


i'm trying disable button controller when directive emits ready status.

i'm passing in boolean ng-disabled:

<button ng-disabled="{{pointsclaimed}}" ng-click="playvideo()">{{buttontext}}</button> 

my controller:

    $scope.buttontext = 'watch video claim points';     $scope.pointsclaimed = false;      $scope.$on('pointsclaimed', function(){         $scope.buttontext = 'points claimed!';         $scope.pointsclaimed = true;     }); 

i can see button changing false true:

enter image description here

enter image description here

but actual button isn't being disabled.

if hardcode in true or false, works expected. if value changing expected in html, why isn't button being disabled?

don't think need curly brackets. try..

<button ng-disabled="pointsclaimed" ng-click="playvideo()">{{buttontext}}</button> 

demo

also demo in docs.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -