removespaces.ts 238 Bytes
Newer Older
1
import { Pipe, PipeTransform } from "@angular/core";
2

Open Source Developer's avatar
Open Source Developer committed
3
@Pipe({
4
    name: "removeSpaces"
Open Source Developer's avatar
Open Source Developer committed
5
})
6

Open Source Developer's avatar
Open Source Developer committed
7
export class RemoveSpaces implements PipeTransform {
8 9 10
    transform(value: string): any {
        return value.replace(/^[ ]+|[ ]+$/g, "");
    }
Open Source Developer's avatar
Open Source Developer committed
11
}