Skip to content

Add BrowserAnimationsModule optional support to new applications #6243

@dave11mj

Description

@dave11mj

Bug Report or Feature Request (mark with an x)

  • bug report -> please search issues before submitting
  • feature request

Versions.

@angular/cli: local (v1.1.0-beta.0, branch: master)
node: 6.9.5
os: darwin x64

Repro steps.

  1. ng new test-animation
  2. Open the app.component.ts and replace its content with the snipped below
import { Component } from '@angular/core';
import { trigger, state, style, animate, transition } from '@angular/animations';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],
  animations: [
    trigger('testFadeIn', [
      state('void', style({ opacity: '0' })),
      state('*',   style({ opacity: '1' })),
      transition('void <=> *', animate('100ms ease-in'))
    ])
  ]
})
export class AppComponent {
  title = 'app';
}
  1. Open app.component.html and use the @testFadeIn trigger
  2. ng serve and open the developer tools.

The log given by the failure.

image

Desired functionality.

To be able to create new applications that support animations without additional configurations. This would make it easier to use transitions and Angular Material.

An option I would propose is a --animation flag to the ng new command which would allow users to opt-in on supporting animations for their applications.

Mention any other details that might be useful.

Animations is one of the features I really like about angular, and can be sometimes tricky to set up. ^^

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions