Created
November 2, 2015 06:18
-
-
Save misaxi/8112923dc5610237f9e0 to your computer and use it in GitHub Desktop.
Ionic: using $ionicHistory to calm down the ion-nav-bar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular | |
.module('app') | |
.config(config) | |
.controller('EventsCtrl', EventsCtrl) | |
function config ($stateProvider) { | |
$stateProvider | |
.state('tab.events', { | |
url: '/events', | |
cache: false, | |
templateUrl: 'templates/events.html', | |
controller: 'EventsCtrl', | |
resolve: EventsCtrl.resolve | |
}) | |
} | |
function EventsCtrl ($scope, events) { | |
angular.extend($scope, { | |
events: events | |
}) | |
} | |
EventsCtrl.resolve = { | |
jobs: ($ionicHistory, EventService) => { | |
$ionicHistory.nextViewOptions({ | |
historyRoot: true | |
}) | |
return EventService.allEvents() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment