Angular 4动画不起作用(没有错误)

时间:2017-05-10 09:45:04

标签: angular animation npm packages

我刚刚安装了@ angular / animations,我没有得到任何错误,但我尝试了很多动画,但没有工作,没有发生任何事情。

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

    animations: [
        trigger('cefac', [
            state('da', style({
                opacitiy: 0.0,
            })),
            state('nu', style({
                opacity: 1.0,
            })),
            transition('da <=> nu', animate('1000ms ease-in')),
        ])
    ]

    pula: string = 'nu'; 

    plm(): void {
        this.pula = (this.pula === 'nu') ? 'da' : 'nu';
        alert ( this.pula );
    } 

我认为依赖有些旧?

  "dependencies": {
    "@angular/animations": "^4.1.1",
    "@angular/common": "^4.1.1",
    "@angular/compiler": "^4.1.1",
    "@angular/core": "^4.1.1",
    "@angular/forms": "^4.1.1",
    "@angular/http": "^4.1.1",
    "@angular/platform-browser": "^4.1.1",
    "@angular/platform-browser-dynamic": "^4.1.1",
    "@angular/router": "^4.1.1",
    "core-js": "^2.4.1",
    "rxjs": "^5.0.1",
    "ts-helpers": "^1.1.1",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@angular/compiler-cli": "^4.1.1",
    "@types/jasmine": "2.5.38",
    "@types/node": "^6.0.42",
    "angular-cli": "1.0.0-beta.28.3",
    "codelyzer": "~2.0.0-beta.1",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "2.5.0",
    "karma": "1.2.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-remap-istanbul": "^0.2.1",
    "protractor": "~4.0.13",
    "ts-node": "1.2.1",
    "tslint": "^4.3.0",
    "typescript": "~2.1.5"
  }

如何解决这个问题? 详细信息详细信息详细信息详细信息详细信息详细信息详细信息详细信息详细信息详细信息详细信息详细信息详细信息详细信息详细信息详细信息详细信息详细信息详细信息detalisdetails详细信息detalisdetails详细信息detalisdetails详细信息detalis

0 个答案:

没有答案