官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 甘孜| 米泉市| 罗城| 宣武区| 中江县| 新竹市| 军事| 库车县| 安国市| 山西省| 儋州市| 南乐县| 元谋县| 惠州市| 舒城县| 南宫市| 仪陇县| 汉川市| 义乌市| 东光县| 和政县| 曲阜市| 林口县| 札达县| 大田县| 沙坪坝区| 鹿邑县| 板桥市| 招远市| 新河县| 郎溪县| 宁南县| 库伦旗| 聊城市| 小金县| 门源| 临泉县| 平凉市| 山西省| 友谊县| 肃宁县|