Skip to content

Instantly share code, notes, and snippets.

@sravan464
Created June 21, 2017 16:55
Show Gist options
  • Select an option

  • Save sravan464/cd608af2111321d007cdac5e9f57d417 to your computer and use it in GitHub Desktop.

Select an option

Save sravan464/cd608af2111321d007cdac5e9f57d417 to your computer and use it in GitHub Desktop.
app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { AppComponent1 } from './app.component1';
import { AppComponent2 } from './app.component2';
import { AppComponent5 } from './app.component5';
import { PageNotFound } from './app.pagenotfound';
import { RouterModule } from '@angular/router';
@NgModule({
imports: [ BrowserModule , RouterModule.forRoot([
{path : 'component1' , component : AppComponent1 },
{path : 'component2' , component : AppComponent2 },
{path : 'component5' , component : AppComponent5 },
{path : '' , redirectTo : 'component1' ,pathMatch : 'full' },
{path : '**' , component : PageNotFound }
]) ],
declarations: [ AppComponent,AppComponent1,AppComponent2,AppComponent5, PageNotFound],
bootstrap: [ AppComponent ]
})
export class AppModule {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment