I get this error when creating a new component in Angular 2.!

I created a new component in angular 2 and I get this error. "The individual declaration in the combined declaration" MyComponentComponent "must be exported or all locally." Since I am new to angular 2, I cannot find the error with the code.! Thanks in advance..!

+6
source share
1 answer

I think you have several classes with the same name MyComponentComponent . When defining a component, you need to take a new name for its implementation class.

 @Component({ (...) }) export class Component1 { (...) } @Component({ (...) }) export class Component2 { (...) } 
+8
source

All Articles