The controller runs twice ONLY on page refresh.

My controllers are fired twice when I refresh the page. However, if I navigate to the page from somewhere else in the app, the controller just fires up once, as expected. The problem only occurs if I refresh the page.

This is a similar problem for these two questions:

  • doubles the execution of the AltularJS controller twice

  • AngularJs: controller is called twice using $ routeProvider

However, the problem I am facing is different in that I only declare my controller in the config routeProvider.

$routeProvider.when('/render/pools/', {
    templateUrl: "app/components/render/pools/views/pools.tpl.html",
    controller: "PoolsCtrl"
}); 

      

I tend to believe this is a problem with the routeProvider module and how I configured it. I'm pretty sure my controllers are only declared in the routeProvider config. I do not use ng-controller

at any time.

Any suggestions?

+3
angularjs angular-routing


source to share


No one has answered this question yet

See similar questions:

496
Fighting AngularJS controller twice
43
AngularJs: controller is called twice using $ routeProvider

or similar:

912
'this' vs $ scope in AngularJS controllers
496
Fighting AngularJS controller twice
83
AngularJS dynamic routing
6
angularjs view loads only on hard update, not on redirect
4
Codeigniter - AngularJS Routing Cause 404
4
Redirect to page on first load and after refresh
1
The script runs twice in the main controller
1
Highstock Navigator appears twice
1
In jquery php app I want to use angularjs route
0
update state and controller on page reload



All Articles
Loading...
X
Show
Funny
Dev
Pics