diff --git a/packages/angular_devkit/schematics/src/rules/template.ts b/packages/angular_devkit/schematics/src/rules/template.ts index 325868a43f..0910b02a67 100644 --- a/packages/angular_devkit/schematics/src/rules/template.ts +++ b/packages/angular_devkit/schematics/src/rules/template.ts @@ -133,12 +133,13 @@ export function applyPathTemplate( if (!(pipe in data)) { throw new UnknownPipeException(pipe); } - if (typeof data[pipe] != 'function') { + const pipeFn = data[pipe]; + if (typeof pipeFn != 'function') { throw new InvalidPipeException(pipe); } // Coerce to string. - return '' + data[pipe](acc); + return '' + pipeFn(acc); }, '' + replacement); }