Skip to content

Commit

Permalink
Rutas en angular
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJonaCode committed Sep 24, 2020
1 parent b6113ab commit a89f7be
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
<app-navbar></app-navbar>
<app-navbar></app-navbar>

<div class="container">

<router-outlet></router-outlet>

</div>
9 changes: 8 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

//RUTAS
import {APP_ROUTING} from './app.routes';

//SERVICIOS

// COMPONENTES
import { AppComponent } from './app.component';
import { NavbarComponent } from './components/shared/navbar/navbar.component';
import { HomeComponent } from './components/home/home.component';
Expand All @@ -16,7 +22,8 @@ import { HeroesComponent } from './components/heroes/heroes.component';
HeroesComponent
],
imports: [
BrowserModule
BrowserModule,
APP_ROUTING
],
providers: [],
bootstrap: [AppComponent]
Expand Down
11 changes: 11 additions & 0 deletions src/app/app.routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

import { RouterModule, Routes } from '@angular/router';
import { HomeComponent } from './components/home/home.component';


const APP_ROUTES: Routes = [
{ path: 'home', component: HomeComponent },
{ path: '**', pathMatch: 'full', redirectTo: 'home' }
];

export const APP_ROUTING = RouterModule.forRoot(APP_ROUTES);

0 comments on commit a89f7be

Please sign in to comment.