I wanted to know how can i have multiple route params and if any of you guys might know a tutorial to it or the answer i would appreciate it so much at this point.
here's what im working on http://jaysg.com/newApp/#/
I want it to be #/:region/:country/:city
so this is the controller
angular.module('NoteWrangler').controller('NotesShowController', function ($scope, $routeParams, $http){
$scope.title = $routeParams.title;
$http.get('js/data/notes.json').success(function(data) {
$scope.note = data.filter(function(entry){
return entry.title === $scope.title;
})[0];
});
});
routes.js
angular.module('NoteWrangler')
.config(function($routeProvider){
$routeProvider.when('/notes', {
templateUrl: 'templates/pages/notes/index.html',
controller: 'NotesIndexController',
controllerAs: 'indexController'
})
.when('/users', {
templateUrl: 'templates/pages/users/index.html',
})
.when('/', {
templateUrl: 'templates/pages/notes/index.html',
controller: 'NotesIndexController',
controllerAs: 'indexController'
})
.when('/:countryName', {
templateUrl: 'templates/pages/notes/country-detail.html',
controller: 'CountryDetailCtrl'
})
.when('/notes/:title', {
templateUrl: 'templates/pages/notes/show.html',
controller: 'NotesShowController',
controllerAs: 'showController'
})
.otherwise( { redirectTo: '/' } )
;
});