Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
feat(title): navigate root on title click
Browse files Browse the repository at this point in the history
  • Loading branch information
marcjulian committed Dec 12, 2018
1 parent b904bce commit 986c4ba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/components/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ion-buttons slot="start">
<ion-menu-button></ion-menu-button>
</ion-buttons>
<ion-title>{{title}}</ion-title>
<ion-title (click)="onTitleClicked()">{{title}}</ion-title>
<ion-buttons slot="end">
<a id="github" href="https://github.com/fivethree-team/fivethree" target="blank">
<ion-icon slot="icon-only" name="logo-github"></ion-icon>
Expand Down
4 changes: 4 additions & 0 deletions src/app/components/header/header.component.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
ion-title {
cursor: pointer;
}

#github {
color: var(--ion-color-light-contrast);
}
7 changes: 6 additions & 1 deletion src/app/components/header/header.component.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { NavController } from '@ionic/angular';
import { Component, OnInit, Input } from '@angular/core';

@Component({
Expand All @@ -9,9 +10,13 @@ export class HeaderComponent implements OnInit {

@Input() title = 'Fivethree';

constructor() { }
constructor(private navController: NavController) { }

ngOnInit() {
}

onTitleClicked() {
this.navController.navigateRoot('/');
}

}

0 comments on commit 986c4ba

Please sign in to comment.