javascript - ng-click expression in view setting $scope.var's value -
<button ng-click="showtext==true">click</button> <p ng-show="showtext">my p</p>
i don't want go the controller.js set showtext equal true show p
why above shortcut doesn't work?
just use =
(assignment operator) instead of ==
(comparison operator)
==
doing comparison instead of assigning value showtext.
markup
<button ng-click="showtext=true">click</button> <p ng-show="showtext">my p</p>
hope :)
Comments
Post a Comment