angular-cn/packages/core/schematics/migrations/injectable-pipe
Alex Eagle 06efc340b6 build: update rules_nodejs and clean up bazel warnings (#30370)
Preserve compatibility with rollup_bundle rule.
Add missing npm dependencies, which are now enforced by the strict_deps plugin in tsc_wrapped

PR Close #30370
2019-05-14 10:08:45 -07:00
..
angular
google3 build: update rules_nodejs and clean up bazel warnings (#30370) 2019-05-14 10:08:45 -07:00
BUILD.bazel
README.md
index.ts fix(core): migrations not always migrating all files (#30269) 2019-05-08 11:54:33 -07:00
util.ts fix(ivy): injectable pipe schematic generating incorrect import statements (#30170) 2019-04-29 09:39:11 -07:00

README.md

Injectable annotation on pipes

In ViewEngine it was possible to inject a class that was annotated as a Pipe, however this no longer works in Ivy if the class also doesn't have the Injectable decorator. This migration adds Injectable automatically to all Pipe classes.

Before

import { Pipe } from '@angular/core';

@Pipe({ name: 'myPipe' })
class MyPipe {}

After

import { Pipe, Injectable } from '@angular/core';

@Injectable()
@Pipe({ name: 'myPipe' })
class MyPipe {}