1
我试图设立Angular2和SystemJs,例如从外部库,这是像这样定义的,我可以导入组件构建环境:力打字稿承认__moduleName
@Component({
moduleId: __moduleName,
selector: 'foo-selector',
templateUrl: 'foo.component.html'
})
我知道肯定这是我想要使用的,因为它在我运行它时起作用。但是Typescript编译失败,因为它无法识别moduleName
。我怎么能告诉Typescript认识到这一点,或者至少不要抱怨呢?
这是打字稿版本2.1.0-dev.20160915和module
在tsconfig.json
我有同样的问题......但在我的情况下,没有编译错误..但在浏览器中我得到'localhost /:23错误:(SystemJS)__moduleName未定义'...有没有解决方案? – Guna
你的tsconfig.json是什么样的?具体地说'compilerOptions.module'部 – yurzui
是啊..像这样, “compilerOptions”:{ “目标”: “ES5”, “模块”: “AMD”, “moduleResolution”: “节点”} – Guna