Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
AngularJS

Route Parameters in AngularJS

Read :id params via $routeParams.

Route Parameters in AngularJS — a practical guide to AngularJS route parameters with clear examples you can reuse in real projects.

AngularJS Tutorial Series (52/99). Prefer one article? Read the complete AngularJS tutorial.

Short description

Watch $routeUpdate or reloadOnSearch settings for query changes.

$routeParams

angular.module('myApp').controller('ItemCtrl', ['$routeParams', 'ItemService', function ($routeParams, ItemService) {
  var vm = this;
  ItemService.get($routeParams.id).then(function (item) { vm.item = item; });
}]);

Leave a reply

Your email address will not be published. Required fields are marked *