I have a controller with a list of items like so:
<ion-item ng-repeat="node in nodes track by node.id" class="item-text-wrap">
<span ng-if="node" ui-sref="node-detail({node:node.id})">
<span class="item-note label monospace">{{node.id}}</span>
{{node.label}}
<div class="node-display-id" ng-if="node.foreignId">{{node.getDisplayId()}}</div>
</span>
</ion-item>
I have confirmed that the rendered HTML is correct:
I have trimmed the /nodes/:nodeId
controller down to basically just this:
.config(function($stateProvider) {
$stateProvider
.state('node-detail', {
url: '/nodes/:node',
templateUrl: nodeDetailTemplate,
controller: 'NodeCtrl'
});
})
.controller('NodeCtrl', function($cordovaGeolocation, $ionicLoading, $ionicPopup, $log, $q, $scope,
$timeout, $window, AvailabilityService, Cache, Capabilities, debounce, Errors, EventService,
NodeService, OutageService, ResourceService, storage, util) {
$log.info('NodeCtrl: initializing.');
$scope.$on('$ionicView.loaded', function(ev, info) {
$log.info('node loaded');
});
$scope.$on('$ionicView.beforeEnter', function(ev, info) {
$log.info('node before enter');
});
});
…and yet $ionicView.beforeEnter
never fires when I click the item. It navigates to the new view, but that view never gets a “back” button:
The only thing I get in the logs is this:
181 744157 info NodeCtrl: initializing.
182 744186 info node loaded
183 744781 debug NodesCtrl: after leave
…so it’s never logging “node before enter
”. Any ideas what’s going wrong?