Professional Documents
Culture Documents
Syntax:
const routes: Routes = [ {path:’’ }, {path:’’} ];
Property Description
path It is the request path used to access any resource in
application.
It specifies the request name.
Syntax:
{ path: ‘home’ }
Request:
http://localhost:4200/home
Syntax:
{ path: ‘ ‘ } – If no component is requested then what to do?
{ path: ‘**’} – If the component requested is not available in
application then what to do?
Syntax:
{path: ‘home’, component: HomeComponent}
redirectTo It specifies the path for redirection.
It uses an existing path instead of loading a new path when
ever the condition is matching.
pathMatch It specifies the URL to access when requested path is similar
to existing path. No need to re-define the path.
- Full: to match all details defined.
- Prefix: to match only the component.
- Hyperlinks are designed to navigate to any specific route path by using “routerLink”
attribute, which is used as “href”
Syntax:
<a routerLink=”pathname”> Link Text / Image </a>