Сибирские интеграционные системы
AngularSIS #1.18 - https://www.youtube.com/playlist?list=PLmEQRj1_Mt5fkeBYOw1o8k_o8-7POFZJN JavaSIS #2.19 - https://www.youtube.com/playlist?list=PLmEQRj1_Mt5f5MlXGlf5kzldb9Rl8Pwuo
Петров Андрей
const routes: Routes = [{
path: '',
pathMatch: 'full',
component: BoardComponent,
}, {
path: 'tasks/:id',
component: TaskPageComponent
}];
@NgModule({
declarations: [AppComponent, BoardComponent, TaskPageComponent],
imports: [CommonModule, RouterModule.forRoot(routes)],
bootstrap: [AppComponent],
})
export class AppModule {
}
<p> Это Канбан! </p>
<router-outlet></router-outlet>
<a routerLink="/user/bob"
routerLinkActive="class1 class2">
Bob
</a>
<a [routerLink]="['user', 'bob']"
[routerLinkActive]="['class1', 'class2']">
Bob
</a>
const routes: Routes = [{
path: '',
pathMatch: 'full',
component: BoardComponent,
}, {
path: 'tasks/:id',
component: TaskPageComponent
}];
constructor(private route: ActivatedRoute, private backend: BackendService) {
}
ngOnInit() {
this.taskSub = this.route.params
.pipe(
map(params => parseInt(params.id, 10)),
switchMap(id => this.backend.getTask(id))
)
.subscribe(task => this.task = task);
}
By Сибирские интеграционные системы
Роутер