Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /route
- import { NgModule } from '@angular/core';
- import { Routes, RouterModule } from '@angular/router';
- import { LoginComponent } from './login/login.component';
- import { SignupComponent } from './signup/signup.component';
- const routes: Routes = [
- {
- path: 'login',
- component: LoginComponent,
- },
- {
- path: 'signup',
- component: SignupComponent,
- },
- {
- path: '',
- redirectTo: '/home',
- pathMatch: 'full'
- }
- ];
- @NgModule({
- imports: [RouterModule.forRoot(routes)],
- exports: [RouterModule]
- })
- export class AppRoutingModule { }
- /app.module
- import { BrowserModule } from '@angular/platform-browser';
- import { NgModule } from '@angular/core';
- import { AppRoutingModule } from './app-routing.module';
- import { AppComponent } from './app.component';
- import { LoginComponent } from './login/login.component';
- import { SignupComponent } from './signup/signup.component';
- import { HomeComponent } from './home/home.component';
- import { Login2Component } from './login2/login2.component';
- import { TestComponent } from './test/test.component';
- @NgModule({
- declarations: [
- AppComponent,
- LoginComponent,
- SignupComponent,
- HomeComponent,
- Login2Component,
- TestComponent
- ],
- imports: [
- BrowserModule,
- AppRoutingModule
- ],
- providers: [],
- bootstrap: [AppComponent]
- })
- export class AppModule { }
- /app.html
- <html>
- <app-login></app-login>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement