I am experiencing an issue with the Angular UI-Router Framework. I have 2 nested views in another one and each time, I change to that "multi-view" View, both controllers I set to the sub-views are reloading there initial methods for both. So when I reload the page and both views are updated, they are both something like double-updated. This leads to the fact, that one of the controllers requests via $http twice some data. Each method I define in the controller will execute twice.
Is there any possibilty to prevent the updating for one of the views. My current suggestion is, that each time a new view is loaded, all ui-views are compiled so it compiles twice for 2 views. :/
The Main HTML:
....
<div ui-view></div>
....
My sub-view is something like this:
...
<div ui-view="view1"></div>
<div ui-view="view2"></div>
...
My App state configuration:
....
.state('model', {
url:"/model/{modelId}",
controller: 'modelCtrl',
templateUrl: 'partials/model.html'
})
.state('model.Overall', {
views: {
'view1': {
templateUrl: 'partials/view1/view.html',
controller: 'view1Ctrl'
},
'view2': {
templateUrl: 'partials/views2/view.html',
controller: 'view2Ctrl'
}
}
})
...