mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-17 02:48:57 -07:00
add trim pipe
This commit is contained in:
parent
fbef856a97
commit
48efea99e5
@ -35,6 +35,7 @@ import { ChartComponent } from './charts/chart/chart.component';
|
||||
import { FolderListComponent } from './lists/folder-list/folder-list.component';
|
||||
import { DialogComponent } from './dialog/dialog.component';
|
||||
import { CardComponent, CardTitleComponent, CardContentComponent } from './card/card.component';
|
||||
import { TrimPipe } from './trim.pipe';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
@ -51,6 +52,7 @@ import { CardComponent, CardTitleComponent, CardContentComponent } from './card/
|
||||
CardComponent,
|
||||
CardTitleComponent,
|
||||
CardContentComponent,
|
||||
TrimPipe,
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
|
8
src/app/trim.pipe.spec.ts
Normal file
8
src/app/trim.pipe.spec.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import { TrimPipe } from './trim.pipe';
|
||||
|
||||
describe('TrimPipe', () => {
|
||||
it('create an instance', () => {
|
||||
const pipe = new TrimPipe();
|
||||
expect(pipe).toBeTruthy();
|
||||
});
|
||||
});
|
12
src/app/trim.pipe.ts
Normal file
12
src/app/trim.pipe.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
|
||||
@Pipe({
|
||||
name: 'trim'
|
||||
})
|
||||
export class TrimPipe implements PipeTransform {
|
||||
|
||||
transform(value: string, ...args: string[]): string {
|
||||
return value.trim();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user