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

Commit 986c4ba

Browse files
committed
feat(title): navigate root on title click
1 parent b904bce commit 986c4ba

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/app/components/header/header.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<ion-buttons slot="start">
44
<ion-menu-button></ion-menu-button>
55
</ion-buttons>
6-
<ion-title>{{title}}</ion-title>
6+
<ion-title (click)="onTitleClicked()">{{title}}</ion-title>
77
<ion-buttons slot="end">
88
<a id="github" href="https://github.com/fivethree-team/fivethree" target="blank">
99
<ion-icon slot="icon-only" name="logo-github"></ion-icon>
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
ion-title {
2+
cursor: pointer;
3+
}
4+
15
#github {
26
color: var(--ion-color-light-contrast);
37
}

src/app/components/header/header.component.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { NavController } from '@ionic/angular';
12
import { Component, OnInit, Input } from '@angular/core';
23

34
@Component({
@@ -9,9 +10,13 @@ export class HeaderComponent implements OnInit {
910

1011
@Input() title = 'Fivethree';
1112

12-
constructor() { }
13+
constructor(private navController: NavController) { }
1314

1415
ngOnInit() {
1516
}
1617

18+
onTitleClicked() {
19+
this.navController.navigateRoot('/');
20+
}
21+
1722
}

0 commit comments

Comments
 (0)