angular-docs-cn/public/docs/_examples/testing/ts/app/my-uppercase.pipe.ts

14 lines
345 B
TypeScript

// #docregion
// #docregion depends-on-angular
import {Pipe, PipeTransform} from 'angular2/core';
// #enddocregion depends-on-angular
@Pipe({ name: 'my-uppercase' })
export class MyUppercasePipe implements PipeTransform {
// #docregion uppercase
transform(value: string) {
return value.toUpperCase();
}
// #enddocregion uppercase
}