diff --git a/packages/schematics/angular/pipe/files/__name@dasherize@if-flat__/__name@dasherize__.pipe.ts.template b/packages/schematics/angular/pipe/files/__name@dasherize@if-flat__/__name@dasherize__.pipe.ts.template index dfe487a73d9d..28ce3d4cb566 100644 --- a/packages/schematics/angular/pipe/files/__name@dasherize@if-flat__/__name@dasherize__.pipe.ts.template +++ b/packages/schematics/angular/pipe/files/__name@dasherize@if-flat__/__name@dasherize__.pipe.ts.template @@ -5,7 +5,7 @@ import { Pipe, PipeTransform } from '@angular/core'; }) export class <%= classify(name) %>Pipe implements PipeTransform { - transform(value: any, args?: any): any { + transform(value: any, ...args: any[]): any { return null; } diff --git a/packages/schematics/angular/pipe/index_spec.ts b/packages/schematics/angular/pipe/index_spec.ts index 70c7b171b3f7..1586f75530ce 100644 --- a/packages/schematics/angular/pipe/index_spec.ts +++ b/packages/schematics/angular/pipe/index_spec.ts @@ -57,6 +57,8 @@ describe('Pipe Schematic', () => { const moduleContent = getFileContent(tree, '/projects/bar/src/app/app.module.ts'); expect(moduleContent).toMatch(/import.*Foo.*from '.\/foo.pipe'/); expect(moduleContent).toMatch(/declarations:\s*\[[^\]]+?,\r?\n\s+FooPipe\r?\n/m); + const fileContent = tree.readContent('/projects/bar/src/app/foo.pipe.ts'); + expect(fileContent).toContain('transform(value: any, ...args: any[])'); }); it('should import into a specified module', async () => {