Created
April 26, 2014 17:49
-
-
Save mlynch/11326470 to your computer and use it in GitHub Desktop.
Ionic Nav Routing API Proposal
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('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