3

I recently updated to angular 4 and checking the animations docs I see I should import trigger, animate and transition from @angular/animations.

import {
  Component,
  Input
} from '@angular/core';
import {
  trigger,
  state,
  style,
  animate,
  transition
} from '@angular/animations';

In my project however I have been importing from @angular/core so far and everything works fine, even after animations were separated from core.

import { ... trigger, state, style, animate, transition } from '@angular/core';

Why does angular core still hold these animation components ? Backwards compatability maybe ? Why not just remove it completely from core?

Lucas
  • 9,871
  • 5
  • 42
  • 52

2 Answers2

3

Imports from @angular/core were deprecated.

https://angular.io/api/core/animate

This symbol has moved. Please Import from @angular/animations instead!

I think they will remove them from core one day.

augustine
  • 538
  • 4
  • 15
2

Taken from the changelog. It is deprecated but you can still use it in your app. Not all programmers have the luxury to update their apps on every new release. It is just a warning that you should update your code, so that when the major release happens, your migration will be smooth. Hope this helps.

brijmcq
  • 3,354
  • 2
  • 17
  • 34