import{
Component,
OnInit,
trigger,
state,
style,
animate,
transition
} from '@angular/core';
当我导入OnInit,触发,状态,样式,动画,从@ angular / core转换为Angular2 ANIMATIONS教程时,但编译时遇到以下错误。
cilent \ app \ components \ home.component.ts(4,3):错误TS2305:模块'" C:/ Users / hcunwei / Library / Projects / codes / node_modules / @ angular /核/索引"'没有导出的成员'触发器'。 cilent \ app \ components \ home.component.ts(5,3):错误TS2305:模块'" C:/ Users / hcunwei / Library / Projects / codes / node_modules / @ angular / core / index& #34;'没有出口会员'州'。 cilent \ app \ components \ home.component.ts(6,3):错误TS2305:模块'" C:/ Users / hcunwei / Library / Projects / codes / node_modules / @ angular / core / index& #34;'没有出口会员的风格'。 cilent \ app \ components \ home.component.ts(7,3):错误TS2305:模块'" C:/ Users / hcunwei / Library / Projects / codes / node_modules / @ angular / core / index& #34;'没有导出的成员' animate'。 cilent \ app \ components \ home.component.ts(8,3):错误TS2305:模块'" C:/ Users / hcunwei / Library / Projects / codes / node_modules / @ angular / core / index& #34;'没有导出的成员'过渡'。
我现在已经解决了这个问题,下面是我的解决方案:
1.更新到rc.2
"@angular/common": "2.0.0-rc.2",
"@angular/compiler": "2.0.0-rc.2",
"@angular/core": "2.0.0-rc.2",
"@angular/forms": "0.1.0",
"@angular/http": "2.0.0-rc.2",
"@angular/platform-browser": "2.0.0-rc.2",
"@angular/platform-browser-dynamic": "2.0.0-rc.2",
"@angular/router": "3.0.0-alpha.7",
"@angular/router-deprecated": "2.0.0-rc.2",
"@angular/upgrade": "2.0.0-rc.2"