我在这个地址做angular2
教程:https://angular.io/docs/ts/latest/tutorial/toh-pt3.html我把hero
接口放在app
文件夹下的一个文件中,在控制台中我有一个错误:
app/app.component.ts(2,20): error TS2306: File 'app/hero.ts' is not a module.
[0] app/hero-detail.component.ts(2,20): error TS2306: File 'app/hero.ts' is not a module.
如果我把我的界面文件放在hero文件夹中,错误就会消失,this is not mentioned in the documentation, what's wrong with my import?
我在app.components.ts
和hero-detail.component.ts
中的import指令(在组件文件的开头):
import {Component} from 'angular2/core';
import {Hero} from './hero';
Must I replace我的进口指令:import {Hero} from './';
or simply put the code in a hero folder?