怎么办AoT不编译模板?

时间:2017-06-02 10:23:53

标签: angular angular2-aot aot

我在一个Angular 4项目中包括AoT,除此之外我没有使用angular-cli,angular-quickstart,或angular-seed,或类似的东西。

所以我开始关注此documentation。 当我运行node_modules/.bin/ngc -p tsconfig-aot.json时出现此错误

Error: Compilation failed. Resource file not found: /xx/app_desktop.html
at ModuleResolutionHostAdapter.readResource (../node_modules/@angular/compiler-cli/src/compiler_host.js:370:19)
at CompilerHost.loadResource (../node_modules/@angular/compiler-cli/src/compiler_host.js:243:85)
at Object.get (../node_modules/@angular/compiler/bundles/compiler.umd.js:24640:107)
at DirectiveNormalizer._fetch (../node_modules/@angular/compiler/bundles/compiler.umd.js:13297:45)
at DirectiveNormalizer.normalizeTemplateAsync (../node_modules/@angular/compiler/bundles/compiler.umd.js:13352:21)
at DirectiveNormalizer.normalizeTemplate (../node_modules/@angular/compiler/bundles/compiler.umd.js:13324:44)
at CompileMetadataResolver._loadDirectiveMetadata (../node_modules/@angular/compiler/bundles/compiler.umd.js:14255:75)
at ../node_modules/@angular/compiler/bundles/compiler.umd.js:14451:54
at Array.forEach (native)
at CompileMetadataResolver.loadNgModuleDirectiveAndPipeMetadata (../node_modules/@angular/compiler/bundles/compiler.umd.js:14450:41)
Compilation failed

因为在AppComponent.ts中我有它

@Component({    
    selector: 'ca-app',    
    templateUrl: '/xx/app_desktop.html'
})

此app_desktop.html通过快递发货。所以有人知道我怎么能为AoT忽略模板?

谢谢。

0 个答案:

没有答案