ich zwei verschachtelten Zustände haben, von einem übergeordneten abstrakten Zustand und einem Kind Zustand bestand:ionicView.enter nicht auf untergeordnete Ansicht und seine Controller gefeuert
.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';
}]
}
})
und zwei Controller sind:
.controller('HCDetailsCtrl',function($scope){
$scope.$on("$ionicView.enter", function (scopes, states) {
...
});
})
.controller('WdcDetailsCtrl',function($scope){
$scope.$on("$ionicView.enter", function (scopes, states) {
...
});
})
Beim Aufruf von state app.heatingControllerDetails.wdc werden beide Controller erstellt, aber $ ionicView.enter wird nur auf dem übergeordneten Controller aufgerufen. Irgendeine Idee?
In heatingController.html, hc-Details ansehen wird wie folgt definiert:
<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>
Möglicherweise möchten Sie in Winkel $ Sendung sehen, so dass Sie die Eltern auf das Kind sehen ankündigen hat ionicView.enter'd: http://stackoverflow.com/questions/19446755/on-and-broadcast -in-eckig und https://docs.angularjs.org/api/ng/type/$rootScope.Scope –