Skip to content

Upgrading angular 5 to 6

Breaking5.3.1 → 6.0.1Breaking6Deprecated1New6Fixed4Other8

BreakingUpgrade verdict

6 breaking changes.

  • Removes the i18n compiler flag previously used to opt in to template internationalization.
  • Code that reacted to input changes through OnChanges must switch to AfterChanges.
  • Imports of ExceptionHandler from the DI library must point to the main Angular library instead.
  • Directive classes that relied on ComponentState must stop using it.
Top 4 of 7 that need code or config changes

Dart SDK requirement changed in 6.0.0: >=2.2.1-dev.3.0 <3.0.0 → >=2.8.4 <3.0.0.

Breaking6
Removes the i18n compiler flag previously used to opt in to template internationalization.
i18n
Removes the OnChanges lifecycle entirely; use AfterChanges instead.
OnChangesAfterChanges
ExceptionHandler is no longer exported from angular/di.dart; import it from angular/angular.dart.
ExceptionHandlerangular/di.dartangular/angular.dart
Directives can no longer extend, implement, or mix in ComponentState.
ComponentState
Removes /deep/ and >>> style combinators for encapsulated components; use ::ng-deep instead.
/deep/>>>::ng-deep
Removes ChangeDetectorRef.checkNoChanges() from the public API.
ChangeDetectorRef.checkNoChanges()
Deprecated1
Deprecates ChangeDetectorRef.detach() and ChangeDetectorRef.reattach().
ChangeDetectorRef.detach()ChangeDetectorRef.reattach()ChangeDetectionStrategy.OnPush