(Navigation) Fix: Navigation items cannot be updated on the fly

This commit is contained in:
sercan 2020-07-23 13:32:01 +03:00
parent 9bc4f49ab2
commit 137b728f95
7 changed files with 18 additions and 18 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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">

View File

@ -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>

View File

@ -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');
}); * });
*/ */
/** /**

View File

@ -68,7 +68,7 @@ export class DocsComponentsNavigationComponent
}; };
this._fuseNavigationService.updateNavigationItem('calendar', { this._fuseNavigationService.updateNavigationItem('calendar', {
type: 'collapsable', type : 'collapsable',
children: [ children: [
newNavItem newNavItem
] ]