Add component for the header bar
This commit is contained in:
parent
e2a3332d82
commit
e7c883ae98
@ -1,3 +1,4 @@
|
||||
<duckbook-header></duckbook-header>
|
||||
<a routerLink="/dashboard">Dashboard</a>
|
||||
<a routerLink="/ducks">Ducks</a>
|
||||
<router-outlet></router-outlet>
|
||||
|
@ -12,6 +12,7 @@ import { AppComponent } from "./app.component";
|
||||
import { DuckDetailComponent } from "./duck-detail.component";
|
||||
import { DashboardComponent } from "./dashboard.component";
|
||||
import { DucksComponent } from "./ducks.component";
|
||||
import { HeaderComponent } from "./header.component";
|
||||
|
||||
import { DuckService } from "./duck.service";
|
||||
import { UserService } from "./user.service";
|
||||
@ -27,7 +28,8 @@ import { UserService } from "./user.service";
|
||||
AppComponent,
|
||||
DashboardComponent,
|
||||
DuckDetailComponent,
|
||||
DucksComponent
|
||||
DucksComponent,
|
||||
HeaderComponent
|
||||
],
|
||||
providers: [
|
||||
DuckService,
|
||||
|
26
app/header.component.html
Normal file
26
app/header.component.html
Normal file
@ -0,0 +1,26 @@
|
||||
<header>
|
||||
<nav class="navbar navbar-default">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<button type="button"
|
||||
class="navbar-toggle collapsed"
|
||||
data-toggle="collapse"
|
||||
data-target="#duckbook-header-inner"
|
||||
aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="#">Rubber Duck Booking Tool</a>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse" id="duckbook-header-inner">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li *ngIf="!userService.currentUser">
|
||||
<a href="#">Login</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
12
app/header.component.ts
Normal file
12
app/header.component.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { Component } from "@angular/core";
|
||||
|
||||
import { UserService } from "./user.service";
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: "duckbook-header",
|
||||
templateUrl: "header.component.html"
|
||||
})
|
||||
export class HeaderComponent {
|
||||
constructor(private userService: UserService) {}
|
||||
}
|
Loading…
Reference in New Issue
Block a user