How to use angularjs routeparam
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Bhuvanesh MohankumarRank #310 · 8.1K reputationPosted Oct 2, 2018, 11:33 AM EDT
The
$routeParamsservice allows you to retrieve the current set of route parameters.Requires the
ngRoutemodule to be installed.The route parameters are a combination of
$location'ssearch()andpath(). Thepathparameters are extracted when the$routepath is matched.// Given:// URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby// Route: /Chapter/:chapterId/Section/:sectionId //// Then$routeParams ==> {chapterId:'1', sectionId:'2', search:'moby'}