Skip to content

Instantly share code, notes, and snippets.

@AlexLakatos
Forked from gsans/capitalisePipe.ts
Created July 21, 2017 11:13
Show Gist options
  • Select an option

  • Save AlexLakatos/73a94a5701017d170f2f8366d338de7d to your computer and use it in GitHub Desktop.

Select an option

Save AlexLakatos/73a94a5701017d170f2f8366d338de7d to your computer and use it in GitHub Desktop.
capitalisePipe.ts
import {Pipe, PipeTransform} from '@angular/core';
@Pipe({
name: 'capitalise'
})
export class CapitalisePipe implements PipeTransform {
transform(value: string): string {
if (typeof value !== 'string') {
throw new Error('Requires a String as input');
}
return value.toUpperCase();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment