Skip to content

Instantly share code, notes, and snippets.

@EpokK
Created June 26, 2014 14:27
Show Gist options
  • Save EpokK/b36bc8bae84884727bdf to your computer and use it in GitHub Desktop.
Save EpokK/b36bc8bae84884727bdf to your computer and use it in GitHub Desktop.
Realiser une injection dans les routes d'AnuglarJS
var resolver = {
crew: function ($q, $route, $timeout, starTrekResource) {
//...
}
}
resolver.crew.$inject = ['$q','$route, '$timeout',' 'starTrekResource'];
$routeProvider.when("/:starship", {
templateUrl:"partials/starship.html",
controller :function ($scope, $routeParams, crew) {
$scope.img = $routeParams.starship + ".jpg";
$scope.crew = crew;
},
resolve : resolver
//...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment