- 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.
- Spring Cloud Alibaba核心技術(shù)與實(shí)戰(zhàn)案例
- 程序員面試白皮書
- 微信公眾平臺(tái)與小程序開發(fā):從零搭建整套系統(tǒng)
- 零基礎(chǔ)學(xué)Java(第4版)
- QTP自動(dòng)化測試進(jìn)階
- Android程序設(shè)計(jì)基礎(chǔ)
- Learning ArcGIS for Desktop
- Citrix XenServer企業(yè)運(yùn)維實(shí)戰(zhàn)
- Web Developer's Reference Guide
- Java EE架構(gòu)設(shè)計(jì)與開發(fā)實(shí)踐
- JavaScript編程精解(原書第2版)
- C語言編程魔法書:基于C11標(biāo)準(zhǔn)
- 讀故事學(xué)編程:Python王國歷險(xiǎn)記
- Java Web應(yīng)用開發(fā)
- Learning Scrapy