jgravois jgravois - 11 months ago 55
AngularJS Question

AngularJS: Can't I set a variable value on ng-click?

I have a modal that uses ng-show="prefs" to determine visibility.

My desire is to use the close button in the modal to set $scope.prefs to false and to use an anchor tag to set the value to true. However, all I can find on google uses a checkbox rather than anchor tags.

Is there a way to use ng-click to set a variable to false?


Just do:

ng-click="prefs = false"