I'm missing something using UI-Router. In my views it will load the partial & JSON when the page loads. On state change, the partial loads but the console states
"Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!".
main.js - config
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('main', {
url: '/main',
templateUrl: 'partials/main/main.html',
controller: 'mainController'
})
.state('main.start', {
url: '/start',
templateUrl: 'partials/main/start.html',
controller : 'startController'
})
.state('main.end', {
url: '/end',
templateUrl: 'partials/main/end.html',
controller : 'endController'
})
//default state
$urlRouterProvider.otherwise('/main/start');
});
controllers.js
.controller('mainController', function($scope, $http) {
$scope.sectionMain = 'partials/main.html';
});
.controller('startController', function($scope, $http) {
// Get Data
$http.get('data/start.json').success(function(datafile) {
$scope.data = datafile;
});
});
.controller('endController', function($scope, $http) {
// End Data
$http.get('data/end.json').success(function(datafile) {
$scope.data = datafile;
});
});
Markup
<div ng-repeat="d in data">
<p>{{ d.heading }}</p>
</div>
Again, if I hit refresh on any of the views it loads both the partial and the data.
When I switch via the ui-sref attributes it just loads the partial with the aforementioned error.
Thanks in advance.