Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Practica1</title>
- <base href="/">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="icon" type="image/x-icon" href="favicon.ico">
- <link rel="stylesheet" href="styles.css">
- </head>
- <body>
- <app-root>Cargando.</app-root>
- </body>
- </html>
- import { Component } from '@angular/core';
- @Component({
- moduleId: module.id,
- selector: 'my-root',
- template: `
- <h1>{{title}}</h1>
- <nav>
- <a routerLink="/dashboard" routerLinkActive="active">Dashboard</a>
- <a routerLink="/heroes" routerLinkActive="active">Heroes</a>
- </nav>
- <router-outlet></router-outlet>
- `,
- styleUrls: ['./app.component.css'],
- })
- export class AppComponent {
- title = 'Tour of Heroes';
- }
- import { Component } from '@angular/core';
- @Component({
- moduleId: module.id,
- selector: 'my-applicacion',
- template: `
- <h1>{{title}}</h1>
- <nav>
- <a routerLink="/dashboard" routerLinkActive="active">Dashboard</a>
- <a routerLink="/heroes" routerLinkActive="active">Heroes</a>
- </nav>
- <router-outlet></router-outlet>
- `,
- styleUrls: ['./app.component.css'],
- })
- export class AppComponent {
- title = 'Tour of Heroes';
- }
- /*
- Copyright 2017 Google Inc. All Rights Reserved.
- Use of this source code is governed by an MIT-style license that
- can be found in the LICENSE file at http://angular.io/license
- */
- import { NgModule } from '@angular/core';
- import { RouterModule, Routes } from '@angular/router';
- import { DashboardComponent } from './dashboard.component';
- import { HeroesComponent } from './heroes.component';
- import { HeroDetailComponent } from './hero-detail.component';
- const routes: Routes = [
- { path: '', redirectTo: '/dashboard', pathMatch: 'full' },
- { path: 'dashboard', component: DashboardComponent },
- { path: 'detail/:id', component: HeroDetailComponent },
- { path: 'heroes', component: HeroesComponent }
- ];
- @NgModule({
- imports: [ RouterModule.forRoot(routes) ],
- exports: [ RouterModule ]
- })
- export class AppRoutingModule {}
- /*
- Copyright 2017 Google Inc. All Rights Reserved.
- Use of this source code is governed by an MIT-style license that
- can be found in the LICENSE file at http://angular.io/license
- */
- import { BrowserModule } from '@angular/platform-browser';
- import { NgModule } from '@angular/core';
- import { FormsModule } from '@angular/forms';
- import { HttpModule } from '@angular/http';
- import { RouterModule } from '@angular/router';
- import { AppComponent } from './app.component';
- import { HeroDetailComponent } from './hero-detail.component';
- import { HeroesComponent } from './heroes.component'
- import { HeroService } from './hero.service'
- import {DashboardComponent} from './dashboard.component'
- import {AppRoutingModule} from './app-routing.module';
- @NgModule({
- declarations: [
- AppComponent,
- HeroDetailComponent,
- HeroesComponent,
- DashboardComponent,
- ],
- imports: [
- BrowserModule,
- FormsModule,
- HttpModule,
- AppRoutingModule,
- ],
- providers: [
- HeroService
- ],
- bootstrap: [AppComponent]
- })
- export class AppModule { }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement