refactor: change titlecase to upperfirst for capitalizing
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
@for (item of items(); track item.value) {
|
@for (item of items(); track item.value) {
|
||||||
<button mat-list-item (click)="action.emit(item.value)">
|
<button mat-list-item (click)="action.emit(item.value)">
|
||||||
<img matListItemAvatar src="{{item.iconSrc}}" alt=""/>
|
<img matListItemAvatar src="{{item.iconSrc}}" alt=""/>
|
||||||
<span matListItemTitle>{{item.label|translate|titlecase}}</span>
|
<span matListItemTitle>{{item.label|translate|upperfirst}}</span>
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
</mat-action-list>
|
</mat-action-list>
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ import { Component, input, output } from '@angular/core';
|
|||||||
import { MatListModule } from '@angular/material/list';
|
import { MatListModule } from '@angular/material/list';
|
||||||
import { IconActionListItem } from './IconActionListItem';
|
import { IconActionListItem } from './IconActionListItem';
|
||||||
import { TranslatePipe } from '@ngx-translate/core';
|
import { TranslatePipe } from '@ngx-translate/core';
|
||||||
import { TitleCasePipe } from '@angular/common';
|
import { UpperfirstPipe } from "../../pipes/upperfirst-pipe";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-icon-action-list',
|
selector: 'app-icon-action-list',
|
||||||
imports: [MatListModule, TranslatePipe, TitleCasePipe],
|
imports: [MatListModule, TranslatePipe, UpperfirstPipe],
|
||||||
templateUrl: './icon-action-list.html',
|
templateUrl: './icon-action-list.html',
|
||||||
styleUrl: './icon-action-list.scss',
|
styleUrl: './icon-action-list.scss',
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
@for (item of items(); track item.label) {
|
@for (item of items(); track item.label) {
|
||||||
<a mat-list-item [routerLink]="item.routerLink">
|
<a mat-list-item [routerLink]="item.routerLink">
|
||||||
<mat-icon matListItemIcon>{{item.icon}}</mat-icon>
|
<mat-icon matListItemIcon>{{item.icon}}</mat-icon>
|
||||||
<span matListItemTitle>{{item.label|translate|titlecase }}</span>
|
<span matListItemTitle>{{item.label|translate|upperfirst }}</span>
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
</mat-nav-list>
|
</mat-nav-list>
|
||||||
@@ -4,11 +4,11 @@ import { MatListModule } from '@angular/material/list';
|
|||||||
import { RouterLink } from '@angular/router';
|
import { RouterLink } from '@angular/router';
|
||||||
import { IconNavListItem } from './IconNavListItem';
|
import { IconNavListItem } from './IconNavListItem';
|
||||||
import { TranslatePipe } from '@ngx-translate/core';
|
import { TranslatePipe } from '@ngx-translate/core';
|
||||||
import { TitleCasePipe } from '@angular/common';
|
import { UpperfirstPipe } from "../../pipes/upperfirst-pipe";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-icon-nav-list',
|
selector: 'app-icon-nav-list',
|
||||||
imports: [MatListModule, MatIcon, RouterLink, TranslatePipe, TitleCasePipe],
|
imports: [MatListModule, MatIcon, RouterLink, TranslatePipe, UpperfirstPipe],
|
||||||
templateUrl: './icon-nav-list.html',
|
templateUrl: './icon-nav-list.html',
|
||||||
styleUrl: './icon-nav-list.scss',
|
styleUrl: './icon-nav-list.scss',
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<mat-icon>arrow_back</mat-icon>
|
<mat-icon>arrow_back</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
<h1>{{title()|translate|titlecase}}</h1>
|
<h1>{{title()|translate|upperfirst}}</h1>
|
||||||
</header>
|
</header>
|
||||||
<ng-content></ng-content>
|
<ng-content></ng-content>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,13 +1,11 @@
|
|||||||
import { TitleCasePipe } from '@angular/common';
|
|
||||||
import { Component, inject, input } from '@angular/core';
|
import { Component, inject, input } from '@angular/core';
|
||||||
import { TranslatePipe } from '@ngx-translate/core';
|
import { TranslatePipe } from '@ngx-translate/core';
|
||||||
import { RouterLink } from "@angular/router";
|
|
||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
import { MatIcon } from "@angular/material/icon";
|
import { MatIcon } from "@angular/material/icon";
|
||||||
import { MatAnchor, MatButton } from "@angular/material/button";
|
import { UpperfirstPipe } from "../../pipes/upperfirst-pipe";
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-simple-layout',
|
selector: 'app-simple-layout',
|
||||||
imports: [TranslatePipe, TitleCasePipe, MatIcon],
|
imports: [TranslatePipe, MatIcon, UpperfirstPipe],
|
||||||
templateUrl: './simple-layout.html',
|
templateUrl: './simple-layout.html',
|
||||||
styleUrl: './simple-layout.scss',
|
styleUrl: './simple-layout.scss',
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user