Commit 7264f7b7 authored by ccottier's avatar ccottier

header and footer components added, routing for country components

parent 3209b2bc
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AccountComponent } from './account.component';
describe('AccountComponent', () => {
let component: AccountComponent;
let fixture: ComponentFixture<AccountComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ AccountComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(AccountComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'account',
templateUrl: './account.component.html',
styleUrls: ['./account.component.css']
})
export class AccountComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
import { SpainComponent } from './spain/spain.component';
import { GreeceComponent } from './greece/greece.component';
import { AccountComponent } from './account/account.component';
import { FranceComponent } from './france/france.component';
import { EnglandComponent } from './england/england.component';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
const routes: Routes = [];
const routes: Routes = [
{path:'england', component: EnglandComponent},
{path:'france', component: FranceComponent},
{path:'account', component: AccountComponent},
{path:'greece', component: GreeceComponent},
{path:'spain', component: SpainComponent}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
......
.dynamic-container{
margin-top: 35px;
height: calc(100vh-70px);
overflow-y: auto;
overflow-x: hidden;
padding: 50px 20px 20px 50px;
}
<div>woooohooo</div>
<router-outlet></router-outlet>
<header></header>
<div class='content' role='main'>
<div class='dynamic-container col-md-10 col-xl-10'>
<router-outlet></router-outlet>
</div>
</div>
<footer></footer>
\ No newline at end of file
......@@ -9,6 +9,7 @@ import { EnglandComponent } from './england/england.component';
import { FranceComponent } from './france/france.component';
import { GreeceComponent } from './greece/greece.component';
import { SpainComponent } from './spain/spain.component';
import { AccountComponent } from './account/account.component';
@NgModule({
declarations: [
......@@ -18,7 +19,8 @@ import { SpainComponent } from './spain/spain.component';
EnglandComponent,
FranceComponent,
GreeceComponent,
SpainComponent
SpainComponent,
AccountComponent
],
imports: [
BrowserModule,
......
.footer{
height: 5rem;
background: #6fb7f1;
bottom: 0;
right: 0;
left: 0;
position:fixed;
}
ul {
font-family: Arial, Verdana;
font-size: 14px;
margin: 0 auto;
padding: 0;
margin-top: 20px;
/* width:600px; */
list-style: none;
}
ul li {
display: block;
position: relative;
float: left;
padding-left: 20px;;
}
\ No newline at end of file
<p>footer works!</p>
<div class='footer'>
<ul>
<li>About Us</li>
<li>Careers</li>
<li>Contact Us</li>
</ul>
</div>
\ No newline at end of file
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-footer',
selector: 'footer',
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.css']
})
......
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-greece',
selector: 'greece',
templateUrl: './greece.component.html',
styleUrls: ['./greece.component.css']
})
......
.header{
background: #6fb7f1;
height: 4em;
position: fixed;
top: 0;
right: 0;
left: 0;
}
.btn{
margin-top: 30px;
margin-left: 10px
}
.btnMenu{
margin-top:20px;
margin-left: 20px;
display:inline-block;
}
.account{
position:absolute;
right:10px;
margin-top: 30px;
}
\ No newline at end of file
<p>header works!</p>
<div class='header'>
<div class='btnMenu'>
<button [routerLink]="['/england']">England</button>
<button [routerLink]= "['/france']">France</button>
<button >Greece</button>
<button >Spain</button>
</div>
<span class='account'>
<i class="fa fa-user" [routerLink]="['/account']" ></i>
</span>
</div>
\ No newline at end of file
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-header',
selector: 'header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.css']
})
......
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-spain',
selector: 'spain',
templateUrl: './spain.component.html',
styleUrls: ['./spain.component.css']
})
......
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