我用过
relative Paths
导入在我的
Angular2
和
TypeScript
应用
实例
(
Source Code
)
import {Http} from 'angular2/http';
import {Injectable} from 'angular2/core';
import {Person} from '../core/Person';
这在windows(tsc v1.7.5)上编译良好,但无法在Linux上加载。
问题:
-
为什么在linux上会这样?
-
有没有一种标准的方法在typescript中声明模块的路径?
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "system",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false
},
"exclude": [
"node_modules",
"wwwroot/lib"
]
}
Ubuntu 14.04出错
wwwroot/app/peopes/people.service。ts(3,22):错误TS2307:找不到模块“../core/Person”。
wwwroot/app/routes.config。ts(1,22):错误TS2307:找不到模块'./home/home'。
wwwroot/app/routes.config。ts(2,23):错误TS2307:找不到模块“./about/about”。
wwwroot/app/routes.config。ts(3,24):错误TS2307:找不到模块“./peopes/people”。
wwwroot/app/routes.config。ts(4,30):错误TS2307:找不到模块“./peopes/PersonDetail”。
从github上的源代码可以看到,Person。ts包含位于wwwroot\app\core\person.ts中的类person
请帮助我解决这个问题。提前谢谢。