Reputation: 794
After installing angular material and adding the components in app.module, I'm getting this error
TypeError: Cannot read property 'id' of undefined.
Upvotes: 1
Views: 729
Reputation: 176
I was having the same issue as you were having until I found your question! Yes. You are correct about importing the module. Importing non-modules will cause Angular to fail in runtime. The function registerNgModuleType(ngModuleType)
, which is the one causing the failure, is meant for modules only, and it is run on each import. So anything without an ngModuleType is not a module, and cannot be properly passed through this function.
Upvotes: 1
Reputation: 794
It turned out, I was importing the components, NOT the modules.
Should not import the components.
Should import the modules.
Upvotes: 5