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:
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>
also demo in docs.
Comments
Post a Comment