mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-01-10 04:25:08 +00:00
(Navigation) Fix: Navigation items cannot be updated on the fly
This commit is contained in:
parent
9bc4f49ab2
commit
137b728f95
|
@ -42,10 +42,10 @@
|
||||||
|
|
||||||
<ng-template #itemContent>
|
<ng-template #itemContent>
|
||||||
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
|
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
|
||||||
<span class="nav-link-title" [translate]="item.translate">{{(item.translate | translate) || item.title}}</span>
|
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
|
||||||
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
|
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
|
||||||
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
|
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
|
||||||
{{(item.badge.translate | translate) || item.badge.title}}
|
{{item.badge.title}}
|
||||||
</span>
|
</span>
|
||||||
<mat-icon class="collapsable-arrow">keyboard_arrow_right</mat-icon>
|
<mat-icon class="collapsable-arrow">keyboard_arrow_right</mat-icon>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
|
@ -38,10 +38,10 @@
|
||||||
|
|
||||||
<ng-template #itemContent>
|
<ng-template #itemContent>
|
||||||
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
|
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
|
||||||
<span class="nav-link-title" [translate]="item.translate">{{(item.translate | translate) || item.title}}</span>
|
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
|
||||||
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
|
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
|
||||||
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
|
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
|
||||||
{{(item.badge.translate | translate) || item.badge.title}}
|
{{item.badge.title}}
|
||||||
</span>
|
</span>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
|
|
|
@ -45,10 +45,10 @@
|
||||||
|
|
||||||
<ng-template #itemContent>
|
<ng-template #itemContent>
|
||||||
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
|
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
|
||||||
<span class="nav-link-title" [translate]="item.translate">{{(item.translate | translate) || item.title}}</span>
|
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
|
||||||
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
|
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
|
||||||
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
|
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
|
||||||
{{(item.badge.translate | translate) || item.badge.title}}
|
{{item.badge.title}}
|
||||||
</span>
|
</span>
|
||||||
<mat-icon class="collapsable-arrow">keyboard_arrow_right</mat-icon>
|
<mat-icon class="collapsable-arrow">keyboard_arrow_right</mat-icon>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<ng-container *ngIf="!item.hidden">
|
<ng-container *ngIf="!item.hidden">
|
||||||
|
|
||||||
<div class="group-title" [ngClass]="item.classes">
|
<div class="group-title" [ngClass]="item.classes">
|
||||||
<span class="hint-text" [translate]="item.translate">{{(item.translate | translate) || item.title}}</span>
|
<span class="hint-text" [translate]="item.translate">{{item.title}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="group-items">
|
<div class="group-items">
|
||||||
|
|
|
@ -38,10 +38,10 @@
|
||||||
|
|
||||||
<ng-template #itemContent>
|
<ng-template #itemContent>
|
||||||
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
|
<mat-icon class="nav-link-icon" *ngIf="item.icon">{{item.icon}}</mat-icon>
|
||||||
<span class="nav-link-title" [translate]="item.translate">{{(item.translate | translate) || item.title}}</span>
|
<span class="nav-link-title" [translate]="item.translate">{{item.title}}</span>
|
||||||
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
|
<span class="nav-link-badge" *ngIf="item.badge" [translate]="item.badge.translate"
|
||||||
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
|
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
|
||||||
{{(item.badge.translate | translate) || item.badge.title}}
|
{{item.badge.title}}
|
||||||
</span>
|
</span>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
|
|
|
@ -86,17 +86,17 @@ export class AppComponent implements OnInit, OnDestroy
|
||||||
* This is related to ngxTranslate module and below there is a temporary fix while we
|
* This is related to ngxTranslate module and below there is a temporary fix while we
|
||||||
* are moving the multi language implementation over to the Angular's core language
|
* are moving the multi language implementation over to the Angular's core language
|
||||||
* service.
|
* service.
|
||||||
**/
|
*/
|
||||||
|
|
||||||
// Set the default language to 'en' and then back to 'tr'.
|
// Set the default language to 'en' and then back to 'tr'.
|
||||||
// '.use' cannot be used here as ngxTranslate won't switch to a language that's already
|
// '.use' cannot be used here as ngxTranslate won't switch to a language that's already
|
||||||
// been selected and there is no way to force it, so we overcome the issue by switching
|
// been selected and there is no way to force it, so we overcome the issue by switching
|
||||||
// the default language back and forth.
|
// the default language back and forth.
|
||||||
/**
|
/**
|
||||||
setTimeout(() => {
|
* setTimeout(() => {
|
||||||
this._translateService.setDefaultLang('en');
|
* this._translateService.setDefaultLang('en');
|
||||||
this._translateService.setDefaultLang('tr');
|
* this._translateService.setDefaultLang('tr');
|
||||||
});
|
* });
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -48,9 +48,9 @@ export class DocsComponentsNavigationComponent
|
||||||
{
|
{
|
||||||
// Update the badge title
|
// Update the badge title
|
||||||
this._fuseNavigationService.updateNavigationItem('mail', {
|
this._fuseNavigationService.updateNavigationItem('mail', {
|
||||||
badge: {
|
badge: {
|
||||||
title: 35
|
title: 35
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ export class DocsComponentsNavigationComponent
|
||||||
};
|
};
|
||||||
|
|
||||||
this._fuseNavigationService.updateNavigationItem('calendar', {
|
this._fuseNavigationService.updateNavigationItem('calendar', {
|
||||||
type: 'collapsable',
|
type : 'collapsable',
|
||||||
children: [
|
children: [
|
||||||
newNavItem
|
newNavItem
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user