I am trying to toggle a div text on click of a button. I tried taking a scope variable and toggeling classname based on the variable. Where am I making the mistake here
<button ng-click="toggle()">test</button>
<div ng-class="{{state}}">
hello test
</div>
function ctrl($scope) {
$scope.state = vis;
$scope.toggle = function() {
state = !state;
};
}
.vis {
display: none;
}