I have a very simple app where I'm trying to call my controller's function like below
var app=angular.module('test',[])
app.controller('ctrl',function($scope){
$scope.func=function(){
alert('hi')
}
})
This is how I'm calling it
<body ng-app='test' >
<h1 ng-controller='ctrl'>{{func()}}</h1>
</body>
The problem which I'm facing is my function is getting called twice.
Read many posts on SO where the reason behind this issue is mostly related to your app configuration or route configuration where by mistake if you have configured same controller for different view or if your app is getting initialized twice then you will face this issue.
But in my case I don't have any such cases but still I'm facing this issue.