In my sample application I have written a feature module \"TempModule\" and below is the code.
import { NgModule } from \'@angular/core\';
import { CommonMod
You're trying to import decorator
in imports
array. It should contain only modules
@NgModule({
declarations: [ TempOneComponent,
TempTwoComponent],
imports: [ NgModule, <== why is it here???
CommonModule,
tempRouting]
})
export class TempModule {}
Solved by adding below code in hero-detail component.
import { NgModule } from '@angular/core';
Another way you can see this error is by importing a module from the wrong place. For example:
import {CommonModule} from '@angular/core'; // wrong
should be:
import {CommonModule} from '@angular/common';