首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ionic3 BrowserAnimationModule

ionic3 BrowserAnimationModule
EN

Stack Overflow用户
提问于 2017-11-01 20:03:46
回答 1查看 212关注 0票数 0

我尝试在项目中导入BrowserAnimaionModule

1- I install npm install web-animations-js @angular/animations@4.0.0 --save

2- i在main.ts中导入多边形填充

导入'web-animations-js/web-animations.min';

3-当我尝试将app.module.ts中的BrowserAnimationModule添加到imports[]中时

这是登录表单的js代码。

代码语言:javascript
复制
 import { Component, trigger, state, style, transition, animate, keyframes } from '@angular/core';
  ;
     
    @Component({
      selector: 'page-login',
      templateUrl: 'login-page.html',
     
      animations: [
     
        //For the logo
        trigger('flyInBottomSlow', [
          state('in', style({
            transform: 'translate3d(0,0,0)'
          })),
          transition('void => *', [
            style({transform: 'translate3d(0,2000px,0'}),
            animate('2000ms ease-in-out')
          ])
        ]),
     
        //For the background detail
        trigger('flyInBottomFast', [
          state('in', style({
            transform: 'translate3d(0,0,0)'
          })),
          transition('void => *', [
            style({transform: 'translate3d(0,2000px,0)'}),
            animate('1000ms ease-in-out')
          ])
        ]),
     
        //For the login form
        trigger('bounceInBottom', [
          state('in', style({
            transform: 'translate3d(0,0,0)'
          })),
          transition('void => *', [
            animate('2000ms 200ms ease-in', keyframes([
              style({transform: 'translate3d(0,2000px,0)', offset: 0}),
              style({transform: 'translate3d(0,-20px,0)', offset: 0.9}),
              style({transform: 'translate3d(0,0,0)', offset: 1}) 
            ]))
          ])
        ]),
     
            })
        
    }

我得到了这个错误,对象原型可能只是一个对象,或者是null:未定义

EN

回答 1

Stack Overflow用户

发布于 2018-10-21 04:41:27

您正在从错误的库中导入触发器、状态、样式、过渡、动画和关键帧。

代码语言:javascript
复制
import { trigger, state, style, animate, transition, keyframes } from '@angular/animations';  // not @angular/core
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47054380

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档