mean-stack-angular6-crud-example
mean-stack-angular6-crud-example copied to clipboard
Fixed `ng test` failed tests, due to errors:
- "If 'router-outlet' is an Angular component, then verify that it is part of this module"
- "If 'router-outlet' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas'"
- "Error: StaticInjectorError(DynamicTestModule)[ApiService -> HttpClient]"
- "StaticInjectorError(DynamicTestModule)[HttpClient -> HttpHandler]"
- "Can't bind to 'routerLink' since it isn't a known property of 'a'"
- "Can't bind to 'formGroup' since it isn't a known property of 'form'"
- "Can't bind to 'errorStateMatcher' since it isn't a known property of 'input'"
- "Can't bind to 'dataSource' since it isn't a known property of 'table'"
- "Error: StaticInjectorError(DynamicTestModule)[RouterLinkWithHref -> Router]"
- "No provider for ControlContainer"
Those errors were faced during ng test
, and fixed step by step for every it().
Code changes verified with:
- Node v10.8.0,
- npm v6.2.0,
- Angular Core v6.0.2,
- Angular Material v6.0.2,
- Angular Forms v6.0.2 and
- Angualr CLI v6.0.0 (also with globally installed Angular CLI 6.1.2)
- Also tested code with Angular v6.1.1 but I will create separate PR for that changes.
Related to issue #5
![screen shot 2018-08-05 at 15 48 29](https://user-images.githubusercontent.com/2131633/43688605-2cc2a0ec-98ec-11e8-91c8-9ef9527ad4bc.png)
up :)