In your app.component.spec.ts, you should declare for the CitiesComponent:import { TestBed, async } from '@angular/core/testing';import { AppComponent } from './app.component';import { CitiesComponent } from './cities/cities.component';describe('AppComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [ AppComponent, CitiesComponent // => add to here ], }); TestBed.compileComponents(); }); //}); 这篇关于Angular2 Cli测试(Webpack)错误:“错误:模板解析错误";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-16 00:20