Ivy Minor Changes

Known Issues

  • Libraries that don't use Angular Package Format aren't processed properly with ngcc (examples: AngularFire, Prime NG). See issue: 30565.

  • We do not yet have support for i18n (planned: v9) or the language service (planned: v10)

  • We are still working on improvements to bundle size and runtime performance (planned: v9).

Breaking changes you may see:

  • All provided or injected tokens must have @Injectable decorator (previously, injected tokens without @Injectable were allowed if another decorator was used, e.g. pipes).

  • By default, @ContentChildren queries will only search direct child nodes in the DOM hierarchy (previously, they would search any nesting level in the DOM as long as another directive wasn't matched above it).

  • Base classes extended by directives must also have an Angular @Directive() decorator if they use Angular-specific features like DI or param decorators (previously, undecorated base classes were allowed).

Less common breaking changes:

  • Injecting the deprecated renderer (Renderer) is not supported (must use Renderer2)

  • Hammer support is opt-in through the HammerModule (previously, it was always included in production bundles regardless of whether the app used Hammer).

  • @ContentChild and @ContentChildren queries will no longer be able to match their directive's own host node (previously, these queries would match the host node in addition to its content children) 

  • If a token is injected with the @Host or @Self flag, the module injector is not searched for that token (previously, tokens marked with these flags would still search at the module level).  

  • Properties like host inside @Component and @Directive decorators can be inherited (previously, only properties with explicit field decorators like @HostBinding would be inherited).

  • Unbound inputs for directives (e.g.  name in <my-comp name="">) are now set upon creation of the view, before change detection runs (previously, all inputs were set during change detection).

  • If a template is declared in one view but inserted into a different view, change detection will occur for that template only when its insertion point is checked (previously, change detection would also run when its declaration point was checked).

  • No longer possible to switch out lifecycle hooks on specific instances for testing (instead, modify the lifecycle hook on the type).

  • Special injection tokens (e.g. TemplateRef or ViewContainerRef) return a new instance whenever they are requested (previously, instances of special tokens were shared if requested on the same node). This primarily affects testing.

  •  When accessing multiple local refs with the same name in template bindings, the first is matched (previously, the last instance was matched).

  • Directives that are used in an exported module (but not exported themselves) are exported without an alias (previously, the compiler would automatically write a private, aliased export that it could use its global knowledge to resolve downstream).

  • Foreign functions or foreign constants in decorator metadata aren't statically resolvable (previously, you could import a constant or function from another compilation unit, like a library, and use that constant/function in your NgModule definition).

  • Forward references to directive inputs accessed through local refs is no longer supported by default.

Example of what's not supported:

{{ dir.dirName }}

<div dir #myDir="dir" [dirName]="name"></div>

Instead:

{{ name }}

<div dir [dirName]="name"></div>