web-dave / cdb-wars

0 stars 0 forks source link

Routing Start #6

Open web-dave opened 4 years ago

web-dave commented 4 years ago

Generiere eine BlaBlaComponent in das AppModule Wenn keine Route angegeben wird, soll die BlaBlaComponent angezeigt werden. Wenn die Route /heros angegeben wird, soll die ListComponent angezeigt werden. Schreibe eine einfache Navigation in der app.component.html

web-dave commented 4 years ago
ng g c BlaBla
web-dave commented 4 years ago

app-routing.module.ts

const routes: Routes = [
  {
    path: '',
    component: BlaBlaComponent,
  },
];
web-dave commented 4 years ago

heros-routing.module.ts

const routes: Routes = [
  {
    path: 'heros',
    component: ListComponent,
  },
];
web-dave commented 4 years ago

app.component.html

<h2><a routerLink="/">BlaBla</a> | <a [routerLink]="['heros']">Heros</a></h2>
<router-outlet></router-outlet>