Commit 0e18290652ae7466dc53044dc51479ea7d6894f6
1 parent
f9a26bd764
Exists in
master
Agregado nuevo componente.
Showing
6 changed files
with
46 additions
and
1 deletions
Show diff stats
src/app/app-routing.module.ts
1 | import { NgModule } from '@angular/core'; | 1 | import { NgModule } from '@angular/core'; |
2 | import { Routes, RouterModule } from '@angular/router'; | 2 | import { Routes, RouterModule } from '@angular/router'; |
3 | import { HomeComponent } from './home/home.component'; | 3 | import { HomeComponent } from './home/home.component'; |
4 | import { InicioComponent } from './inicio/inicio.component'; | 4 | import { InicioComponent } from './inicio/inicio.component'; |
5 | import { BusquedaProductosComponent } from './busqueda-productos/busqueda-productos.component'; | ||
5 | 6 | ||
6 | const routes: Routes = [ | 7 | const routes: Routes = [ |
7 | { path: 'home', component: HomeComponent }, | 8 | { path: 'home', component: HomeComponent }, |
8 | { path: 'inicio', component: InicioComponent }, | 9 | { path: 'inicio', component: InicioComponent }, |
10 | { path: 'busqueda-productos', component: BusquedaProductosComponent }, | ||
9 | { path: '**', redirectTo: '/home', pathMatch: 'full' }, | 11 | { path: '**', redirectTo: '/home', pathMatch: 'full' }, |
10 | ]; | 12 | ]; |
11 | 13 | ||
12 | @NgModule({ | 14 | @NgModule({ |
13 | imports: [RouterModule.forRoot(routes)], | 15 | imports: [RouterModule.forRoot(routes)], |
14 | exports: [RouterModule] | 16 | exports: [RouterModule] |
15 | }) | 17 | }) |
16 | export class AppRoutingModule { } | 18 | export class AppRoutingModule { } |
17 | 19 |
src/app/app.module.ts
1 | import { BrowserModule } from '@angular/platform-browser'; | 1 | import { BrowserModule } from '@angular/platform-browser'; |
2 | import { NgModule } from '@angular/core'; | 2 | import { NgModule } from '@angular/core'; |
3 | 3 | ||
4 | import { AppRoutingModule } from './app-routing.module'; | 4 | import { AppRoutingModule } from './app-routing.module'; |
5 | import { AppComponent } from './app.component'; | 5 | import { AppComponent } from './app.component'; |
6 | import { HeaderComponent } from './header/header.component'; | 6 | import { HeaderComponent } from './header/header.component'; |
7 | import { SidebarComponent } from './sidebar/sidebar.component'; | 7 | import { SidebarComponent } from './sidebar/sidebar.component'; |
8 | import { CarouselComponent } from './carousel/carousel.component'; | 8 | import { CarouselComponent } from './carousel/carousel.component'; |
9 | import { HomeComponent } from './home/home.component'; | 9 | import { HomeComponent } from './home/home.component'; |
10 | import { InicioComponent } from './inicio/inicio.component'; | 10 | import { InicioComponent } from './inicio/inicio.component'; |
11 | import { BusquedaProductosComponent } from './busqueda-productos/busqueda-productos.component'; | ||
11 | 12 | ||
12 | @NgModule({ | 13 | @NgModule({ |
13 | declarations: [ | 14 | declarations: [ |
14 | AppComponent, | 15 | AppComponent, |
15 | HeaderComponent, | 16 | HeaderComponent, |
16 | SidebarComponent, | 17 | SidebarComponent, |
17 | CarouselComponent, | 18 | CarouselComponent, |
18 | HomeComponent, | 19 | HomeComponent, |
19 | InicioComponent | 20 | InicioComponent, |
21 | BusquedaProductosComponent | ||
20 | ], | 22 | ], |
21 | imports: [ | 23 | imports: [ |
22 | BrowserModule, | 24 | BrowserModule, |
23 | AppRoutingModule | 25 | AppRoutingModule |
24 | ], | 26 | ], |
25 | providers: [], | 27 | providers: [], |
26 | bootstrap: [AppComponent] | 28 | bootstrap: [AppComponent] |
27 | }) | 29 | }) |
28 | export class AppModule { } | 30 | export class AppModule { } |
29 | 31 |
src/app/busqueda-productos/busqueda-productos.component.html
File was created | 1 | <p>busqueda-productos works!</p> | |
2 |
src/app/busqueda-productos/busqueda-productos.component.scss
src/app/busqueda-productos/busqueda-productos.component.spec.ts
File was created | 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
2 | |||
3 | import { BusquedaProductosComponent } from './busqueda-productos.component'; | ||
4 | |||
5 | describe('BusquedaProductosComponent', () => { | ||
6 | let component: BusquedaProductosComponent; | ||
7 | let fixture: ComponentFixture<BusquedaProductosComponent>; | ||
8 | |||
9 | beforeEach(async(() => { | ||
10 | TestBed.configureTestingModule({ | ||
11 | declarations: [ BusquedaProductosComponent ] | ||
12 | }) | ||
13 | .compileComponents(); | ||
14 | })); | ||
15 | |||
16 | beforeEach(() => { | ||
17 | fixture = TestBed.createComponent(BusquedaProductosComponent); | ||
18 | component = fixture.componentInstance; | ||
19 | fixture.detectChanges(); | ||
20 | }); | ||
21 | |||
22 | it('should create', () => { | ||
23 | expect(component).toBeTruthy(); | ||
24 | }); | ||
25 | }); | ||
26 |
src/app/busqueda-productos/busqueda-productos.component.ts
File was created | 1 | import { Component, OnInit } from '@angular/core'; | |
2 | |||
3 | @Component({ | ||
4 | selector: 'app-busqueda-productos', | ||
5 | templateUrl: './busqueda-productos.component.html', | ||
6 | styleUrls: ['./busqueda-productos.component.scss'] | ||
7 | }) | ||
8 | export class BusquedaProductosComponent implements OnInit { | ||
9 | |||
10 | constructor() { } | ||
11 | |||
12 | ngOnInit() { | ||
13 | } | ||
14 | |||
15 | } | ||
16 |