consider my url is like
#/desktop/admin/reconciliationconfig/nav/ledger/GMO-DDA-21819971/detail
,
My question is how can I get all segments of the route in angular?
My expected result is
['desktop','admin','reconciliationconfig','nav','ledger','GMO-DDA-21819971','detail']
Note GMO-DDA-21819971
is a route param and will be changed dynamically
After getting the url from the router
object, you can simply use the split
function in the string
this.router.url.split('/');