본문 바로가기

[angular] route and parameter const appRoutes: Routes = [ { path: '', component: HomeComponent }, { path: 'users', component: UsersComponent }, { path: 'users/:id/:name', component: UserComponent }, { path: 'servers', component: ServersComponent }];we can see third one's path is..
[angular] Router navigate relatively we know this last post,this.router.navigate(['/servers']);this is absolute path. but funny thing is this code.this.router.navigate(['servers']);this looks like relative path. but it is not,routerLink in html acts relatively with ['servers'] but navigate..
[angular] Router Navigation programmatically To Navigate Router programmatically, We need this!constructor(private router:Router) { }and use it like this.this.router.navigate(['/servers']);*Don't forget '/server' is absolute path.
[angular] routerLinkActive and routerLinkOptions <li role="presentation" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}"><a routerLink="/">Home</a></li>-routerLinkActive = "XXX": 현재 주소가 routerLink와 같으면 XXX를 적용한다.-routerLinkActiveOptions: l..
[angluar] routerLink with path currentPath: localhost/users<a routerLink="servers">Reload Page</a>=> localhost/users/servers (just from current location)<a routerLink="/servers">Reload Page</a>=> localhost/servers (absolute)<a routerLink="../servers"&..
[angular] href VS routerlink <a href="/">Home</a>=> show the page with reloading<a routerLink="/">Home</a>=> show the page without reloading
[angular] Router 1. Register RoutesIn app.module.tsconst appRoutes: Routes = [ { path: '', component: HomeComponent }, { path: 'users', component: UsersComponent }, { path: 'servers', component: ServersComponent }];@NgModule({ imports: [ RouterModule.forRoot(appR..
[WEB] `와 '의 차이  ` : Note the backticks ( ` ) that define a JavaScript template literal for embedding the id.':Note the single quotation marks(') that means strings containing