0% found this document useful (0 votes)
32 views1 page

Import From Import From: Const

This document contains code defining routes and modules for an Angular application. It imports Page1Component and Page2Component, defines routes for these pages and a default redirect, and exports the routing configuration. It also imports this routing configuration along with other modules into the AppModule to declare and configure the root module for the application.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views1 page

Import From Import From: Const

This document contains code defining routes and modules for an Angular application. It imports Page1Component and Page2Component, defines routes for these pages and a default redirect, and exports the routing configuration. It also imports this routing configuration along with other modules into the AppModule to declare and configure the root module for the application.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

[Link].

ts
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { Page1Component } from './components/page1/[Link]';


import { Page2Component } from './components/page2/[Link]';

const APP_ROUTES: Routes = [


{ path: 'page1', component: Page1Component },
{ path: 'page2', component: Page2Component },
{ path: '**', redirectTo: '/page1', pathMatch: 'full' }
];

export const APP_ROUTING = [Link](APP_ROUTES);

[Link]

import { BrowserModule } from '@angular/platform-browser';


import { NgModule } from '@angular/core';

import { FormsModule } from '@angular/forms';


import { HttpModule } from '@angular/http';

// Rutas
import { APP_ROUTING } from './[Link]';

import { AppComponent } from './[Link]';


import { NavbarComponent } from './components/shared/navbar/[Link]';
import { Page1Component } from './components/page1/[Link]';
import { Page2Component } from './components/page2/[Link]';

@NgModule({
declarations: [
AppComponent,
NavbarComponent,
Page1Component,
Page2Component,
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
APP_ROUTING
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }

You might also like