When I use ngView
and call a controller inside another one, this makes any process twice :
$routeProvider
.when('/', {
templateUrl: '/main.html',
controller: 'main'
})
.when('/user', {
templateUrl: '/user.html',
controller: 'user'
})
});
<body ng-controller="main">
<div ng-view><!--here is another controller --></div>
</body>
When using ngInclude
there is not this problem. What is wrong with using ngView
?
It looks like if you are using your main
controller twice:
Probably you want remove the ng-controller
from your index page?