Commit 9a7256ac9d81da7d1af190af0eb2df1b4ff395fc
1 parent
541e947900
Exists in
master
Renombrado componente.
Showing
11 changed files
with
60 additions
and
53 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 { CargarProductosComponent } from './cargar-productos/cargar-productos.component'; | 4 | import { InicioComponent } from './inicio/inicio.component'; | 
| 5 | 5 | ||
| 6 | const routes: Routes = [ | 6 | const routes: Routes = [ | 
| 7 | { path: 'home', component: HomeComponent }, | 7 | { path: 'home', component: HomeComponent }, | 
| 8 | { path: 'cargar-productos', component: CargarProductosComponent }, | 8 | { path: 'inicio', component: InicioComponent }, | 
| 9 | { path: '**', redirectTo: '/home', pathMatch: 'full' }, | 9 | { path: '**', redirectTo: '/home', pathMatch: 'full' }, | 
| 10 | ]; | 10 | ]; | 
| 11 | 11 | ||
| 12 | @NgModule({ | 12 | @NgModule({ | 
| 13 | imports: [RouterModule.forRoot(routes)], | 13 | imports: [RouterModule.forRoot(routes)], | 
| 14 | exports: [RouterModule] | 14 | exports: [RouterModule] | 
| 15 | }) | 15 | }) | 
| 16 | export class AppRoutingModule { } | 16 | export class AppRoutingModule { } | 
| 17 | 17 | 
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 { CargarProductosComponent } from './cargar-productos/cargar-productos.component'; | 10 | import { InicioComponent } from './inicio/inicio.component'; | 
| 11 | 11 | ||
| 12 | @NgModule({ | 12 | @NgModule({ | 
| 13 | declarations: [ | 13 | declarations: [ | 
| 14 | AppComponent, | 14 | AppComponent, | 
| 15 | HeaderComponent, | 15 | HeaderComponent, | 
| 16 | SidebarComponent, | 16 | SidebarComponent, | 
| 17 | CarouselComponent, | 17 | CarouselComponent, | 
| 18 | HomeComponent, | 18 | HomeComponent, | 
| 19 | CargarProductosComponent | 19 | InicioComponent | 
| 20 | ], | 20 | ], | 
| 21 | imports: [ | 21 | imports: [ | 
| 22 | BrowserModule, | 22 | BrowserModule, | 
| 23 | AppRoutingModule | 23 | AppRoutingModule | 
| 24 | ], | 24 | ], | 
| 25 | providers: [], | 25 | providers: [], | 
| 26 | bootstrap: [AppComponent] | 26 | bootstrap: [AppComponent] | 
| 27 | }) | 27 | }) | 
| 28 | export class AppModule { } | 28 | export class AppModule { } | 
| 29 | 29 | 
src/app/cargar-productos/cargar-productos.component.html
| 1 | <div class="row m-0"> | File was deleted | |
| 2 | <div class="col-10 p-0"> | ||
| 3 | <div class="bg-danger py-1 py-sm-2 py-lg-5"> | ||
| 4 | <p class="text-center">HEADER</p> | ||
| 5 | </div> | ||
| 6 | </div> | ||
| 7 | <app-sidebar class="col-3 col-md-2 vh-100 bg-dark text-white"></app-sidebar> | ||
| 8 | </div> | 
src/app/cargar-productos/cargar-productos.component.scss
src/app/cargar-productos/cargar-productos.component.spec.ts
| 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | File was deleted | |
| 2 | |||
| 3 | import { CargarProductosComponent } from './cargar-productos.component'; | ||
| 4 | |||
| 5 | describe('CargarProductosComponent', () => { | ||
| 6 | let component: CargarProductosComponent; | ||
| 7 | let fixture: ComponentFixture<CargarProductosComponent>; | ||
| 8 | |||
| 9 | beforeEach(async(() => { | ||
| 10 | TestBed.configureTestingModule({ | ||
| 11 | declarations: [ CargarProductosComponent ] | ||
| 12 | }) | ||
| 13 | .compileComponents(); | ||
| 14 | })); | ||
| 15 | |||
| 16 | beforeEach(() => { | ||
| 17 | fixture = TestBed.createComponent(CargarProductosComponent); | ||
| 18 | component = fixture.componentInstance; | ||
| 19 | fixture.detectChanges(); | ||
| 20 | }); | ||
| 21 | |||
| 22 | it('should create', () => { | ||
| 23 | expect(component).toBeTruthy(); | ||
| 24 | }); | ||
| 25 | }); | ||
| 26 | 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | 
src/app/cargar-productos/cargar-productos.component.ts
| 1 | import { Component, OnInit } from '@angular/core'; | File was deleted | |
| 2 | |||
| 3 | @Component({ | ||
| 4 | selector: 'app-cargar-productos', | ||
| 5 | templateUrl: './cargar-productos.component.html', | ||
| 6 | styleUrls: ['./cargar-productos.component.scss'] | ||
| 7 | }) | ||
| 8 | export class CargarProductosComponent implements OnInit { | ||
| 9 | |||
| 10 | constructor() { } | ||
| 11 | |||
| 12 | ngOnInit() { | ||
| 13 | } | ||
| 14 | |||
| 15 | } | ||
| 16 | 1 | import { Component, OnInit } from '@angular/core'; | 
src/app/home/home.component.ts
| 1 | import { Component, OnInit, HostListener } from '@angular/core'; | 1 | import { Component, OnInit, HostListener } from '@angular/core'; | 
| 2 | import { Router } from '@angular/router'; | 2 | import { Router } from '@angular/router'; | 
| 3 | 3 | ||
| 4 | @Component({ | 4 | @Component({ | 
| 5 | selector: 'app-home', | 5 | selector: 'app-home', | 
| 6 | templateUrl: './home.component.html', | 6 | templateUrl: './home.component.html', | 
| 7 | styleUrls: ['./home.component.scss'] | 7 | styleUrls: ['./home.component.scss'] | 
| 8 | }) | 8 | }) | 
| 9 | export class HomeComponent implements OnInit { | 9 | export class HomeComponent implements OnInit { | 
| 10 | 10 | ||
| 11 | constructor(private router: Router) { } | 11 | constructor(private router: Router) { } | 
| 12 | 12 | ||
| 13 | ngOnInit() { | 13 | ngOnInit() { | 
| 14 | } | 14 | } | 
| 15 | 15 | ||
| 16 | @HostListener('document:click', ['$event']) | 16 | @HostListener('document:click', ['$event']) | 
| 17 | documentClick(event: MouseEvent) { | 17 | documentClick(event: MouseEvent) { | 
| 18 | this.router.navigate(['/cargar-productos']); | 18 | this.router.navigate(['/inicio']); | 
| 19 | } | 19 | } | 
| 20 | 20 | ||
| 21 | } | 21 | } | 
| 22 | 22 | 
src/app/inicio/inicio.component.html
| File was created | 1 | <div class="row m-0"> | |
| 2 | <div class="col-10 p-0"> | ||
| 3 | <app-header></app-header> | ||
| 4 | |||
| 5 | <!-- <div class="row" > | ||
| 6 | <div class="col-12"> | ||
| 7 | |||
| 8 | <p class="h3 text-center">COMPONENTES RESTANTES</p> | ||
| 9 | |||
| 10 | </div> | ||
| 11 | </div> --> | ||
| 12 | |||
| 13 | </div> | ||
| 14 | <app-sidebar class="col-3 col-md-2 vh-100 bg-dark text-white"></app-sidebar> | ||
| 15 | </div> | 
src/app/inicio/inicio.component.scss
src/app/inicio/inicio.component.spec.ts
| File was created | 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
| 2 | |||
| 3 | import { InicioComponent } from './inicio.component'; | ||
| 4 | |||
| 5 | describe('InicioComponent', () => { | ||
| 6 | let component: InicioComponent; | ||
| 7 | let fixture: ComponentFixture<InicioComponent>; | ||
| 8 | |||
| 9 | beforeEach(async(() => { | ||
| 10 | TestBed.configureTestingModule({ | ||
| 11 | declarations: [ InicioComponent ] | ||
| 12 | }) | ||
| 13 | .compileComponents(); | ||
| 14 | })); | ||
| 15 | |||
| 16 | beforeEach(() => { | ||
| 17 | fixture = TestBed.createComponent(InicioComponent); | ||
| 18 | component = fixture.componentInstance; | ||
| 19 | fixture.detectChanges(); | ||
| 20 | }); | ||
| 21 | |||
| 22 | it('should create', () => { | ||
| 23 | expect(component).toBeTruthy(); | ||
| 24 | }); | ||
| 25 | }); | ||
| 26 | 
src/app/inicio/inicio.component.ts
| File was created | 1 | import { Component, OnInit } from '@angular/core'; | |
| 2 | |||
| 3 | @Component({ | ||
| 4 | selector: 'app-inicio', | ||
| 5 | templateUrl: './inicio.component.html', | ||
| 6 | styleUrls: ['./inicio.component.scss'] | ||
| 7 | }) | ||
| 8 | export class InicioComponent implements OnInit { | ||
| 9 | |||
| 10 | constructor() { } | ||
| 11 | |||
| 12 | ngOnInit() { | ||
| 13 | } | ||
| 14 | |||
| 15 | } | ||
| 16 |