I have two nested states consisting of a parent abstract state and a child state:
.state('app.heatingControllerDetails', { url: "/clients/:clientId/heatingControllers/:heatingControllerId", abstract: true, views: { 'menuContent': { templateUrl: "templates/heatingController.html", controller: 'HCDetailsCtrl' } } }) .state('app.heatingControllerDetails.wdc', { url: "/wdc", views: { 'hc-details': { templateUrl: "templates/heatingControllers/wdc.html", controller: 'WdcDetailsCtrl' } }, resolve:{ hcFamily: [function(){ return 'wdc'; }] } })
and two controllers:
.controller('HCDetailsCtrl',function($scope){ $scope.$on("$ionicView.enter", function (scopes, states) { ... }); }) .controller('WdcDetailsCtrl',function($scope){ $scope.$on("$ionicView.enter", function (scopes, states) { ... }); })
When I call state app.heatingControllerDetails.wdc, both controllers are created, but $ ionicView.enter is called only on the parent controller. Any idea?
In the heatingController.html file, the hc-details view is defined as follows:
<ion-content class="has-header" ng-show="hc"> <div ui-view name="hc-details"></div> <div class="disableContentDiv" ng-hide="hc.state=='Online'"></div> </ion-content>
state ionic ionic-view
Gregor srdic
source share