1

I am including AoT in an Angular 4 project, besides that I am not using angular-cli, or angular-quickstart, or angular-seed, or something like that.

So I started following this documentation. When I run node_modules/.bin/ngc -p tsconfig-aot.json I have this error

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

Because in the AppComponent.ts I have it

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

This app_desktop.html is shipped through express. So someone knows how could I do for AoT ignores templates?

Thank you.

Kelyane
  • 467
  • 2
  • 7
  • 19
  • 2
    We have no solution for this approach. Please read this topic https://stackoverflow.com/questions/40963355/load-angular2-template-from-external-url – Thien Hoang Jun 02 '17 at 11:59
  • It seems angular4 is really not very flexible in it's current state. – Tyguy7 Jun 21 '17 at 19:44

0 Answers0