简体   繁体   中英

How to serialize Angular URL with auxiliary routing?

Currently what is being happening is, when you navigate to any aux route the URL page will be

my-url/(router-name:aux)

What I want is, it should be something like

my-url/router-name/aux

Is this even logical? I don't know if it will contradict with any primary routing.

Thanks

I've just used URLSerializer provided by Angular itself. You can find the official docs here .

All we need to do here is parse URL to actual one, and serialize the parsed URL to desired one and both can be achieved via UrlSerializer methods (parse and serialize respectively).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM