Skip to content

Instantly share code, notes, and snippets.

@mlynch
Created April 26, 2014 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlynch/11326470 to your computer and use it in GitHub Desktop.
Save mlynch/11326470 to your computer and use it in GitHub Desktop.
Ionic Nav Routing API Proposal
angular.module('myApp', ['ionic'])
.config(function($ionicNavProvider)) {
$ionicNavProvider.url('/contact/:contactId', {
templateUrl: 'contact.html',
controller: 'ContactCtrl',
extra: {}
})
})
.controller('MyCtrl', $scope, $ionicNavDelegate) {
var nav = $ionicNavDelegate($scope);
// Explicit routing
$scope.openMessage = function(message) {
nav.push('message.html', 'MessageCtrl', {
message: message
});
// Pushed with a named animation, OR pass in a function or animation object which controls the animation
nav.pushWithAnimation('message.html', 'MessageCtrl', 'slide-up', {
message: message
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment