FirstController.js
function FirstController($scope) {
$scope.$apply(function () {
$scope.add = function (amount) {
$scope.counter += amount;
}
});}
its view **Addtion.html**
<div ng-controller="FirstController">
<h4>The simplest add</h4>
<button ng-click="add(1)" class="button">Add</button>
<h4>Current count: {{ counter }}</h4>
</div>
its working when calling from this above view
button link on index view outside the this view is following
Index view Index.html
<button ng-controller="FirstController" ng-click=" add(1);">Add</button>
this above button is on main view.. its change in counter is not reflecting in ui why??