Skip to content

Commit 3b4d98d

Browse files
committed
feat(header): use routerLink for brand instead of href attribute
1 parent 6c0b02f commit 3b4d98d

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

projects/coreui/angular/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"peerDependencies": {
2020
"@angular/common": "^7.2.5",
2121
"@angular/core": "^7.2.5",
22+
"@angular/router": "^7.2.5",
2223
"@coreui/coreui": "^2.1.6"
2324
},
2425
"repository": {

projects/coreui/angular/src/lib/header/app-header.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<span class="navbar-toggler-icon"></span>
44
</button>
55
</ng-template>
6-
<a class="navbar-brand" [href]="navbarBrandHref">
6+
<a class="navbar-brand" [routerLink]="navbarBrandRouterLink">
77
<ng-template [ngIf]="navbarBrandImg">
88
<img *ngIf="navbarBrand"
99
[appHtmlAttr]="navbarBrand"

projects/coreui/angular/src/lib/header/app-header.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ export class AppHeaderComponent implements OnInit, OnDestroy {
1313
@Input() navbarBrandFull: any;
1414
@Input() navbarBrandMinimized: any;
1515
@Input() navbarBrandText: any = {icon: '🅲', text: '🅲 CoreUI'};
16-
@Input() navbarBrandHref: any = '';
16+
@Input() navbarBrandRouterLink: any[] | string = '';
1717

18-
@Input() sidebarToggler: any;
19-
@Input() mobileSidebarToggler: any;
18+
@Input() sidebarToggler: string | boolean;
19+
@Input() mobileSidebarToggler: boolean;
2020

21-
@Input() asideMenuToggler: any;
22-
@Input() mobileAsideMenuToggler: any;
21+
@Input() asideMenuToggler: string | boolean;
22+
@Input() mobileAsideMenuToggler: boolean;
2323

2424
private readonly fixedClass = 'header-fixed';
2525
navbarBrandImg: boolean;

projects/coreui/angular/src/lib/header/app-header.module.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import { CommonModule} from '@angular/common';
1+
import { CommonModule } from '@angular/common';
22
import { NgModule } from '@angular/core';
3+
import { RouterModule } from '@angular/router';
34

4-
import { LayoutModule } from '../shared/layout/layout.module';
5+
import { LayoutModule } from '../shared/layout';
56
import { AppHeaderComponent } from './app-header.component';
67

78
@NgModule({
89
imports: [
910
CommonModule,
11+
RouterModule,
1012
LayoutModule
1113
],
1214
exports: [

0 commit comments

Comments
 (0)