html :
<p>
<a class="btn btn-lg btn-success" href="#"ng-click="splendido()">{{salute}}</a></p>
main.js
$scope.splendido=function()
{
var calls=1;
$scope.salute='I am greeting you for the first time';
if(calls==2)$scope.salute="This is your second encounter";
if(calls==3)$scope.salute="Third time's a charm";
if(calls>3)$scope.salute="You are starting to get on my nerves" ;
calls++;
}
The button triggers the splendido() function every time it is clicked. My objective is to update the content of {{salute}} more than once. However, I am facing difficulties achieving this. Why isn't the content updating as expected?
I am implementing Angular js 1.5.8