Reputation: 19903
I have this :
$routeProvider
.when('/Customer/:id?', {
templateUrl: templatePath + 'Customer/Detail.html',
controller: 'myAngularJsController',
caseInsensitiveMatch: true
})
.otherwise({
redirectTo: '/defaultroute'
});
The URL is : http://localhost:39765/#/Customer/7
I'd like get the value (7) in my page Detail.html
, in an angularJs variable, how can I do this ?
Thanks,
Upvotes: 1
Views: 45
Reputation: 193261
Inject $routeParams
service into myAngularJsController
controller and read param by key
console.log($routeParams.id);
Upvotes: 1