jgravois jgravois - 5 months ago 15
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"