Angular2"没有导出的成员bootstrap"错误

时间:2016-09-04 07:53:25

标签: angular typescript

我的Atom编辑器显示:

  

模块'" C:/ express4 / node_modules / @ angular / platform-b​​rowser-dynamic / index"'具有   没有导出的成员' bootstrap' .at line 2 col 10

对于TypeScript文件中的以下导入:

import { bootstrap } from '@angular/platform-browser-dynamic';

知道这个警告的原因是什么?

2 个答案:

答案 0 :(得分:26)

假设您使用的是Angular RC6 / RC5,您可以尝试以下代码:

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
platformBrowserDynamic().bootstrapModule(AppModule);

答案 1 :(得分:0)

我正在使用ionic2 rc0并且必须按照此处所述添加以下依赖项https://github.com/driftyco/ionic2-app-base/blob/master/package.json#L15-L24

"@angular/common": "^2.0.0",
"@angular/compiler": "^2.0.0",
"@angular/compiler-cli": "^0.6.2",
"@angular/core": "^2.0.0",
"@angular/forms": "^2.0.0",
"@angular/http": "^2.0.0",
"@angular/platform-browser": "^2.0.0",
"@angular/platform-browser-dynamic": "^2.0.0",
"@angular/platform-server": "^2.0.0",