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

Commit

Permalink
fix(app-bar): fix routing, now using NavController
Browse files Browse the repository at this point in the history
  • Loading branch information
garygrossgarten committed Dec 9, 2018
1 parent 83ef702 commit ba8c46e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion projects/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fivethree/core",
"version": "0.1.2",
"version": "0.1.3",
"description": "Fivethree Core Components",
"keywords": [
"fivethree",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<fiv-ripple (fivClick)="link.click()" class="tab" [ngClass]="{'active': active}">
<a [href]="href" #link></a>
<fiv-ripple (fivClick)="onClick()" class="tab" [ngClass]="{'active': active}">
<fiv-icon [fivCenter] [name]="icon"></fiv-icon>
</fiv-ripple>
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component, OnInit, Input} from '@angular/core';
import { Component, OnInit, Input } from '@angular/core';
import { NavController } from '@ionic/angular';

@Component({
selector: 'fiv-app-bar-tab-content',
Expand All @@ -12,8 +13,12 @@ export class AppBarTabContentComponent implements OnInit {
@Input() active = false;


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

ngOnInit() {
}

onClick() {
this.nav.navigateRoot(this.href);
}
}
3 changes: 2 additions & 1 deletion projects/core/src/lib/app-bar/app-bar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import { AppBarTabComponent } from '../app-bar-tab/app-bar-tab.component';
import { Router } from '@angular/router';
import { AppBarTabContentComponent } from '../app-bar-tab-content/app-bar-tab-content.component';
import { NavController } from '@ionic/angular';

@Component({
selector: 'fiv-app-bar',
Expand Down Expand Up @@ -75,7 +76,7 @@ export class AppBarComponent implements OnInit, AfterViewInit {



constructor(private router: Router) { }
constructor() { }

ngOnInit() {
}
Expand Down

0 comments on commit ba8c46e

Please sign in to comment.