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> 

plunker

hope :)


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -