如果我使用AOT evertying工作正常,但如果我改为JIT ....
获取错误:
Error: ENOENT: no such file or directory, open 'home.html'
at Error (native)
以下是我的组件的样子:
import { Component, OnInit } from '@angular/core';
import 'rxjs/add/observable/of';
import { Observable } from 'rxjs/Observable'
@Component({
selector: 'app-home',
templateUrl: './home.html'
})
export class HomeComponent implements OnInit {
ngOnInit() {
let src = Observable.of(10);
var subscription = src.subscribe(
(x: any) => console.log('onNext: %s', x),
(e: any) => console.log('onError: %s', e),
() => console.log('onCompleted'));
}
}
主要模块:
// Angular
import '@angular/platform-browser';
import '@angular/platform-browser-dynamic';
import '@angular/core';
import '@angular/common';
// RxJS
import 'rxjs';
// Other vendors for example jQuery, Lodash or Bootstrap
// You can import js, ts, css, sass, ...
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/set';
import 'core-js/es6/reflect';
import 'core-js/es7/reflect';
import 'zone.js/dist/zone';
// import { platformBrowser } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
// import { AppClientModuleNgFactory } from '../built/src/app/app.client.module.ngfactory';
import { AppClientModule } from './app/app.client.module';
// platformBrowser().bootstrapModuleFactory(AppClientModuleNgFactory);
platformBrowserDynamic().bootstrapModule(AppClientModule);
任何人都知道什么是问题?我尝试moduleId: module.id.toString(),
组件也尝试添加完整路径,但没有同样的错误。