(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>
<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"
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{(item.badge.translate | translate) || item.badge.title}}
{{item.badge.title}}
</span>
<mat-icon class="collapsable-arrow">keyboard_arrow_right</mat-icon>
</ng-template>

View File

@ -38,10 +38,10 @@
<ng-template #itemContent>
<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"
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{(item.badge.translate | translate) || item.badge.title}}
{{item.badge.title}}
</span>
</ng-template>

View File

@ -45,10 +45,10 @@
<ng-template #itemContent>
<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"
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{(item.badge.translate | translate) || item.badge.title}}
{{item.badge.title}}
</span>
<mat-icon class="collapsable-arrow">keyboard_arrow_right</mat-icon>
</ng-template>

View File

@ -1,7 +1,7 @@
<ng-container *ngIf="!item.hidden">
<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 class="group-items">

View File

@ -38,10 +38,10 @@
<ng-template #itemContent>
<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"
[ngStyle]="{'background-color': item.badge.bg,'color': item.badge.fg}">
{{(item.badge.translate | translate) || item.badge.title}}
{{item.badge.title}}
</span>
</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
* are moving the multi language implementation over to the Angular's core language
* service.
**/
*/
// 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
// been selected and there is no way to force it, so we overcome the issue by switching
// the default language back and forth.
/**
setTimeout(() => {
this._translateService.setDefaultLang('en');
this._translateService.setDefaultLang('tr');
});
* setTimeout(() => {
* this._translateService.setDefaultLang('en');
* this._translateService.setDefaultLang('tr');
* });
*/
/**