When adding routing to an AngularCLI project you need to also update the startup test with the RouterTestingModule.
Failure to do so results in the following error when running ng test:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Failed: 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' |
Here is the fix (click on the image to enlarge):
Source code available here:
https://github.com/stevenh77/angular-lob-app/commit/f582ecf5034af3222a686ae0e9f237f6528aefa6
No comments:
Post a Comment