Réponse
$routeParams.id in the controller
Colonne
Explication
We use Angular’s $routeParams to retrieve id from the URL by using $routeParams.id and adding a variable part named id to the URL, like this: /photos/:id.
exemple :
app.controller('PhotoController', ['$scope', 'photos', '$routeParams', function($scope, photos, $routeParams) {
photos.success(function(data) {
$scope.detail = data[$routeParams.id];
});
}]);
Question
Angular’s $routeParams allow to retrieve id from the URL by using ?
Thématique