Commit 24c27ff5 authored by dbhuller's avatar dbhuller

added routes for home and not found error

parent b0a53606
......@@ -6,15 +6,19 @@ import { GreeceComponent } from './greece/greece.component';
import { SpainComponent } from './spain/spain.component';
import { AccountComponent } from './account/account.component';
import { ContactComponent } from './contact/contact.component';
import { HomeComponent } from './home/home.component';
import { NotfoundComponent } from './notfound/notfound.component';
const routes: Routes = [
{ path: 'home', component: HomeComponent },
{ path: 'england', component: EnglandComponent },
{ path: 'france', component: FranceComponent },
{ path: 'account', component: AccountComponent },
{ path: 'greece', component: GreeceComponent },
{ path: 'spain', component: SpainComponent },
{ path: 'contact', component: ContactComponent }
{ path: 'contact', component: ContactComponent },
{ path: '**', component: NotfoundComponent}
];
@NgModule({
......
......@@ -15,6 +15,8 @@ import { SpainComponent } from './spain/spain.component';
import { GreeceComponent } from './greece/greece.component';
import { AccountComponent } from './account/account.component';
import { ContactComponent } from './contact/contact.component';
import { HomeComponent } from './home/home.component';
import { NotfoundComponent } from './notfound/notfound.component';
@NgModule({
declarations: [
......@@ -26,7 +28,9 @@ import { ContactComponent } from './contact/contact.component';
SpainComponent,
GreeceComponent,
AccountComponent,
ContactComponent
ContactComponent,
HomeComponent,
NotfoundComponent
],
imports: [
BrowserModule,
......
<div class="header">
<div class="btnMenu">
<button [routerLink]="['/home']">Home</button>
<button [routerLink]="['/england']">England</button>
<button [routerLink]="['/france']">France</button>
<button [routerLink]="['/spain']">Spain</button>
......
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { HomeComponent } from './home.component';
describe('HomeComponent', () => {
let component: HomeComponent;
let fixture: ComponentFixture<HomeComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ HomeComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(HomeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
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(): void {
}
}
.fof{
display: table-cell;
vertical-align: middle;
}
.fof h1{
font-size: 50px;
display: inline-block;
padding-right: 12px;
animation: type .5s alternate infinite;
}
@keyframes type{
from{box-shadow: inset -3px 0px 0px #888;}
to{box-shadow: inset -3px 0px 0px transparent;}
}
\ No newline at end of file
<div class="fof">
<h1>Error 404 - Not Found</h1>
</div>
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { NotfoundComponent } from './notfound.component';
describe('NotfoundComponent', () => {
let component: NotfoundComponent;
let fixture: ComponentFixture<NotfoundComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ NotfoundComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(NotfoundComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-notfound',
templateUrl: './notfound.component.html',
styleUrls: ['./notfound.component.css']
})
export class NotfoundComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment