Created
February 12, 2016 20:23
-
-
Save icfantv/81a87f36cc4d4fd2129b to your computer and use it in GitHub Desktop.
Sample Route Provider
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
export function SampleRouteConfiguration($routeProvider) { | |
$routeProvider.when('/customer', { | |
controller: 'CustomerListController', | |
controllerAs: 'customers', | |
templateUrl: 'path/to/customers.html', | |
resolve: { | |
consumers: ['CustomerService', CustomerService => CustomerService.getAll()] | |
} | |
}).when('/customer/:id', { | |
controller: 'CustomerController', | |
controllerAs: 'customer', | |
templateUrl: 'path/to/customer.html', | |
resolve: { | |
consumer: ['$route', 'CustomerService', ($route, CustomerService) => CustomerService.get($route.current.params.id)] | |
} | |
}); | |
} | |
SampleRouteConfiguration.$inject = ['$routeProvider']; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment