# ng-click change value of a var

I’m trying to set ng-click to modify a var inside my controller.

I’ve tried to set ng-click to target the var mar.

<div class="Button" ng-click="mar = 'test-2';">


inside the controller.js i have this

eventsApp.controller('EventController', function EventController($scope) { //variables var mar = 'test-1'; }  So what i was hoping is to get var mar changed to ‘test-2’; but, my html page just keeps displaying test-1. is there a directive or a way to dynamically change var mar? I do not want to have to setup a$scope.mar = ‘test-1’ and manipulate that. How can i do this? Thank you.

Source: AngularJS