Anup
Anup

Reputation: 9746

AngularJs - Toggle values on ng-click

I want to toogle value on click, so if value of $scope.customize is false then it should set as true & vice versa.

$scope.customize = false;

<div ng-if="customize">
     <button class="btn btn-sm btn-success">Save</button>
     <button class="btn btn-sm btn-primary">Add</button>
</div>

<span title="Customize" ng-click="????">Customize</span>

What to code in span ng-click to toggle values?

Upvotes: 1

Views: 1059

Answers (1)

Guy Segev
Guy Segev

Reputation: 1835

ng-click="customize = !customize"

Upvotes: 5

Related Questions