- Angular Router
- Victor Savkin
- 144字
- 2021-07-09 19:20:31
Applying redirects

The router gets a URL from the user, either when she clicks on a link or updates the location bar directly. The first thing that router does with this URL is it will apply any redirects.
What is a redirect?
Note
A redirect is a substitution of a URL segment. Redirects can either be local or absolute. Local redirects replace a single segment with a different one. Absolute redirects replace the whole URL. Redirects are local unless you prefix the url with a slash.
The provided configuration has only one redirect rule: { path: '', pathMatch: 'full', redirectTo: '/inbox' }
, i.e., replace /
with /inbox
. This redirect is absolute because the redirectTo
value starts with a slash.
Since we are navigating to /inbox/33/messages/44
and not /
, the router will not apply any redirects, and the URL will stay as is.
- Java面向?qū)ο筌浖_(kāi)發(fā)
- 小程序,巧運(yùn)營(yíng):微信小程序運(yùn)營(yíng)招式大全
- QGIS:Becoming a GIS Power User
- 正則表達(dá)式經(jīng)典實(shí)例(第2版)
- Learning Python by Building Games
- Node.js Design Patterns
- Illustrator CS6設(shè)計(jì)與應(yīng)用任務(wù)教程
- ActionScript 3.0從入門(mén)到精通(視頻實(shí)戰(zhàn)版)
- 跟戴銘學(xué)iOS編程:理順核心知識(shí)點(diǎn)
- PHP動(dòng)態(tài)網(wǎng)站開(kāi)發(fā)實(shí)踐教程
- Spring Boot 3:入門(mén)與應(yīng)用實(shí)戰(zhàn)
- Visual Basic 開(kāi)發(fā)從入門(mén)到精通
- Scratch 3.0少兒積木式編程(6~10歲)
- Natural Language Processing with Java Cookbook
- Java從入門(mén)到精通(第7版)