I just started studying Angular (v11.0.2 in my source code), and I came across a behavior that I didn't understand.
The problem:
Clone app-structure and code in StackBlitz (major v10, behavior is the same):
see code (after loading, go manually to URL /workspace)
I trying to use SubcompComponent in WorkspaceComponent (see HTML-template), for lazy-loading WorkspaceModule (see AppRoutingModule and WorkspaceRoutingModule). Metadata selector is specified correctly. But I really can't understand what I'm doing wrong.
Q: Why is the component not loading?
What I tried to do:
- Adding
SubcompComponenttodeclarationsandexportsinWorkspaceModule(see code workspace.module.ts) - Also I tried use
SharedModule(see workspace.module.ts too (commented line's)) as directed from the guide Sharing Modules - Studied the main docs articles, including NgModule FAQ Lazy Loading NgModules and many others.
Probably, i'm not see the wood for the trees? Any ideas?
Additional:
Plese, suggest best practices for more detailed debugging (why a particular component is loaded now and when). So far, I only use Augury (Chromium) and write in VS Code.
Thank you in advance and excuse my English.