mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 07:23:03 +00:00
Merge branch 'w2p-54053_Active-filter-labels' into search-features
This commit is contained in:
18
src/app/shared/utils/capitalize.pipe.ts
Normal file
18
src/app/shared/utils/capitalize.pipe.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core'
|
||||
|
||||
/**
|
||||
* Pipe to truncate a value in Angular. (Take a substring, starting at 0)
|
||||
* Default value: 10
|
||||
*/
|
||||
@Pipe({
|
||||
name: 'dsCapitalize'
|
||||
})
|
||||
export class CapitalizePipe implements PipeTransform {
|
||||
transform(value: string, args: string[]): string {
|
||||
if (value) {
|
||||
return value.charAt(0).toUpperCase() + value.slice(1);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user