From 1dac8b65775cb485cea44258275f20d16837f232 Mon Sep 17 00:00:00 2001 From: Alexis Hernandez Date: Sun, 11 Mar 2018 09:59:57 -0600 Subject: [PATCH] web-ui: Add HomeComponent and link it to the router --- web-ui/src/app/app-routing.module.ts | 3 +++ web-ui/src/app/app.component.html | 20 +-------------- web-ui/src/app/app.component.ts | 1 - web-ui/src/app/app.module.ts | 4 ++- .../app/components/home/home.component.css | 0 .../app/components/home/home.component.html | 3 +++ .../components/home/home.component.spec.ts | 25 +++++++++++++++++++ .../src/app/components/home/home.component.ts | 15 +++++++++++ 8 files changed, 50 insertions(+), 21 deletions(-) create mode 100644 web-ui/src/app/components/home/home.component.css create mode 100644 web-ui/src/app/components/home/home.component.html create mode 100644 web-ui/src/app/components/home/home.component.spec.ts create mode 100644 web-ui/src/app/components/home/home.component.ts diff --git a/web-ui/src/app/app-routing.module.ts b/web-ui/src/app/app-routing.module.ts index e54f915..7e70a9e 100644 --- a/web-ui/src/app/app-routing.module.ts +++ b/web-ui/src/app/app-routing.module.ts @@ -1,7 +1,10 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; +import { HomeComponent } from './components/home/home.component'; + const routes: Routes = [ + { path: '', component: HomeComponent }, { path: '**', redirectTo: '' } ]; diff --git a/web-ui/src/app/app.component.html b/web-ui/src/app/app.component.html index b96ea2a..79be59c 100644 --- a/web-ui/src/app/app.component.html +++ b/web-ui/src/app/app.component.html @@ -1,20 +1,2 @@ - -
-

- Welcome to {{title}}! -

- Angular Logo -
-

Here are some links to help you start:

- + diff --git a/web-ui/src/app/app.component.ts b/web-ui/src/app/app.component.ts index 7b0f672..68478a8 100644 --- a/web-ui/src/app/app.component.ts +++ b/web-ui/src/app/app.component.ts @@ -6,5 +6,4 @@ import { Component } from '@angular/core'; styleUrls: ['./app.component.css'] }) export class AppComponent { - title = 'app'; } diff --git a/web-ui/src/app/app.module.ts b/web-ui/src/app/app.module.ts index 78def9c..a6192b2 100644 --- a/web-ui/src/app/app.module.ts +++ b/web-ui/src/app/app.module.ts @@ -13,10 +13,12 @@ import { ToastrModule } from 'ngx-toastr'; import { NgHttpLoaderModule } from 'ng-http-loader/ng-http-loader.module' import { AppComponent } from './app.component'; +import { HomeComponent } from './components/home/home.component'; @NgModule({ declarations: [ - AppComponent + AppComponent, + HomeComponent ], imports: [ AppRoutingModule, diff --git a/web-ui/src/app/components/home/home.component.css b/web-ui/src/app/components/home/home.component.css new file mode 100644 index 0000000..e69de29 diff --git a/web-ui/src/app/components/home/home.component.html b/web-ui/src/app/components/home/home.component.html new file mode 100644 index 0000000..afc16a3 --- /dev/null +++ b/web-ui/src/app/components/home/home.component.html @@ -0,0 +1,3 @@ +

+ home works! +

diff --git a/web-ui/src/app/components/home/home.component.spec.ts b/web-ui/src/app/components/home/home.component.spec.ts new file mode 100644 index 0000000..490e81b --- /dev/null +++ b/web-ui/src/app/components/home/home.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HomeComponent } from './home.component'; + +describe('HomeComponent', () => { + let component: HomeComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ HomeComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(HomeComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/web-ui/src/app/components/home/home.component.ts b/web-ui/src/app/components/home/home.component.ts new file mode 100644 index 0000000..33fd770 --- /dev/null +++ b/web-ui/src/app/components/home/home.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-home', + templateUrl: './home.component.html', + styleUrls: ['./home.component.css'] +}) +export class HomeComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +}