coreui / coreui-free-bootstrap-admin-template

Free Bootstrap Admin & Dashboard Template
https://coreui.io/product/free-bootstrap-admin-template/
MIT License
11.98k stars 3.13k forks source link

when running ng test - got a 'router-outlet' is not a known element - error - Angular 4 #202

Closed henry-hz closed 4 years ago

henry-hz commented 7 years ago

Trying to run "ng test" on angular4 starter application.

I am using : node v8.1.4 npm 5.0.3

Error: Template parse errors:
'router-outlet' is not a known element:
1. If 'router-outlet' is an Angular component, then verify that it is part of this module.
2. If 'router-outlet' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("[ERROR ->]<router-outlet></router-outlet>"): ng:///DynamicTestModule/AppComponent.html@0:0
mokipedia commented 7 years ago

getting the same here, using yarn 0.21.0, cloned gitrepo yesterday

mokipedia commented 7 years ago

For everyone else having this issue:

in app.component.spec.ts

reference:

ManfredGit commented 7 years ago

using mokipedia's solution, not work for me.

mukeshfull commented 6 years ago

@mokipedia is awesome. My error gone.

hmaiga commented 6 years ago

@mokipedia solution works fine for me, thxs guy 👍

Qocotzxin commented 6 years ago

@mokipedia Thanks, that's THE solution! Just in case someone uses the Atom's Angular snippet, the spec file does not include the "import" array by default so you will have to add it to the configureTestingModule by yourself, and include only the RouterTestingModule

mokipedia commented 6 years ago

thats cool that it helps. Just wanted to follow up for everyone else having this issues: coreui seems to have moved angular5 development to a new repository (where this error is obviously fixed): https://github.com/mrholek/CoreUI-Angular

adv2028 commented 6 years ago

@mokipedia It worked! Thanks!

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.