Angular 2 xi18n无法解析组件目录

时间:2016-11-01 14:45:22

标签: angular typescript angular2-template

我正在尝试在Angular 2 版本2.1.1 中使用新的xi18n。当我运行./node_modules/.bin/ng-xi18n命令来提取我遇到此错误的语言环境时:

  

错误:编译失败。找不到资源文件:   C:/Projects/SellPro/javaSolution/branches/work/webapp/sellPro/app/ts/templates/app.component.html       在Object.get(C:\ Projects \ SellPro \ javaSolution \ branches \ work \ webapp \ sellPro \ node_modules \ @angular \ compiler-cli \ src \ extract_i18n.js:13:23)       在DirectiveNormalizer._fetch(C:\ Projects \ SellPro \ javaSolution \ branches \ work \ webapp \ sellPro \ node_modules \ @angular \ compiler \ bundles \ compiler.umd.js:13661:45)       在DirectiveNormalizer.normalizeTemplateAsync(C:\ Projects \ SellPro \ javaSolution \ branches \ work \ webapp \ sellPro \ node_modules \ @angular \ compiler \ bundles \ compiler.umd.js:13707:23)       在DirectiveNormalizer.normalizeDirective(C:\ Projects \ SellPro \ javaSolution \ branches \ work \ webapp \ sellPro \ node_modules \ @angular \ compiler \ bundles \ compiler.umd.js:13681:46)       在C:\ Projects \ SellPro \ javaSolution \ branches \ work \ webapp \ sellPro \ node_modules \ @angular \ compiler-cli \ src \ extractor.js:45:64       at Array.forEach(native)       在C:\ Projects \ SellPro \ javaSolution \ branches \ work \ webapp \ sellPro \ node_modules \ @angular \ compiler-cli \ src \ extractor.js:40:29       at Array.forEach(native)       在Extractor.extract(C:\ Projects \ SellPro \ javaSolution \ branches \ work \ webapp \ sellPro \ node_modules \ @angular \ compiler-cli \ src \ extractor.js:38:15)       在extract(C:\ Projects \ SellPro \ javaSolution \ branches \ work \ webapp \ sellPro \ node_modules \ @angular \ compiler-cli \ src \ extract_i18n.js:19:35)   提取失败

项目结构:

enter image description here

我的项目结构是单独的模板文件夹,它不在 ts 文件夹中。当我跟踪错误时,我看到 directive_normalizer.js 中的 urlResolver.resolve 方法接受 moduleUrl templateUrl作为参数。有没有办法改变它或只是指向xi18n从模板目录中读取?

0 个答案:

没有答案