Ok figured it out with some guidance from Stewie in the comments.
My app has routing, and it was navigating to MyController like so:
1 2 3 4 5 |
$routeProvider.when('/', { templateUrl: 'pages/home.html', controller: MyController }); |
But I also had this in home.html:
1 2 3 |
<div data-ng-controller="MyController"> |
Which was instructing AngularJS to digest my controller twice. To solve it I simply removed the data-ng-controller from my HTML.
Obviously really when I think about it!
ref:
https://stackoverflow.com/questions/15535336/combating-angularjs-executing-controller-twice