Angular2:同一组件上两个共享动画的语法是什么?

时间:2017-02-09 14:10:39

标签: javascript angular animation

我是Angular2的新手,我试图在同一个组件上指定两个共享动画效果。我知道如何在组件上放置单个共享动画,但我无法弄清楚如何在同一组件上添加多个共享动画的语法。

我有一个设置组件同时具有溃败动画效果(当显示组件时)和关于绿色吐司的淡入效果(在提交成功后提交时消息淡入和淡出)

我知道在组件注释中我需要指定动画。

import {Component, OnInit, ViewChild,ElementRef, HostListener} from '@angular/core';

import {NavigationAnimation} from '../../shared/animations/navigation/navigationAnimation'; // path to animation
import { FadeInOutAnimation} from '../../shared/animations/fadeInOut/fadeInOut';   // path to animation

@Component({
    selector: 'setup-app',
    templateUrl: 'app/setup/setup.component/setup.component.html',
    styleUrls: ['app/setup/setup.component/setup.component.css', 'bower_components/semantic/dist/components/form.min.css', 'bower_components/semantic/dist/components/dropdown.css'],
    host: { '[@routeAnimation]': 'true' },
     animations:  NavigationAnimation.page \\  I can get either the NavigationAnimation.page to work or the FadeInOutAnimation.effect but I can get the two of them to work at the same time.
})

0 个答案:

没有答案