Changes

Jump to navigation Jump to search
635 bytes added ,  14:55, 2 May 2022
m
no edit summary
Line 150: Line 150:  
....
 
....
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
== Routing ==
 +
 +
=== app-routing.module.ts ===
 +
<syntaxhighlight lang="typescript">
 +
import { RouterModule, Routes } from '@angular/router';
 +
import {LoginComponent} from "./login/login.component";
 +
import {ErrorComponent} from "./error/error.component";
 +
 +
const routes: Routes = [
 +
  { path: '', component: LoginComponent},
 +
  { path: 'login', component: LoginComponent},
 +
  { path: 'welcome', component: LoginComponent},
 +
  { path: '**', component: ErrorComponent}
 +
];
 +
 +
@NgModule({
 +
  imports: [RouterModule.forRoot(routes)],
 +
  exports: [RouterModule]
 +
})
 +
export class AppRoutingModule { }
 +
 +
</syntaxhighlight>
 +
 +
== Error component ==
 +
ng g c error

Navigation menu