I have a problem where a controller executes twice, yet I do not have duplicates that i can see (even running a case sensiTIve search through my files only shows one in route configuration and my actual controller).
Route config:
$routeProvider.when('/cb159e1ec61d0613f10ab397d8bd6782',{
templateUrl: view+'passwordreset.html',
controller:'passwordreset'
});
Controller:
App.controller('passwordreset',['$scope','$http',
function($scope,$http){
$scope.token='asdf'
console.log($scope.token); // <-- logs 2x to console
}]);
passwordreset.html
:
<div class="row">
<div class="small-12 columns">
<fieldset class="content-box">
password reset {{token}}
</fieldset>
</div>
</div>
Also, I've created a new route and tried, still logs twice. I've cleared my cache as well. Some controllers execute once, some twice (I put an alert in a few controllers, some show once, some twice)
another example:
//route config
$routeProvider.when('/', {
templateUrl: view+'home',
controller:'Home'
});
//template
<div ng-controller="testing">a</div>
//controller
Lmu.controller('Home',function($scope){
$scope.home='home';
alert($scope.home); <-- alerts 2x (two scopes for Home controller are created)
});