【发布时间】:2016-05-11 17:23:40
【问题描述】:
我正在尝试使用 TypeScript 启动基本的 Angular 2(beta 2)应用程序。我有以下app.ts 文件(从Angular's latest setup guide 复制)
import {Component, View, bootstrap} from 'angular2/angular2';
@Component({
selector: 'app'
})
@View({
template: `
<div></div>
`
})
class AppComponent {
constructor() {}
}
bootstrap(AppComponent);
但是当我尝试编译它时,我得到了错误
错误 TS2307:找不到模块 'angular2/angular2'。
如果我改用在其他资源上找到的格式,使用 angular2/core 而不是 angular2/angular2 就像
import {Component, View, bootstrap} from 'angular2/core';
我得到错误
错误 TS2305:模块 '"node_modules/angular2/core"' 没有导出的成员 'bootstrap'。
我应该怎么做才能全部导入?
【问题讨论】:
标签: typescript angular