Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am Getting this error while creating a new component in Angular 2.!

Tags:

angular

I have created the new component in angular 2 and I am getting this error "Individual declaration in merged declaration 'MyComponentComponent' must be all exported or all local." As I am new to angular 2 I am not able to figure out the error on code need help.! Thanks in advance ..!

like image 376
Pranay Sute Avatar asked Apr 29 '16 08:04

Pranay Sute


1 Answers

I think that 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 {
  (...)
}
like image 59
Thierry Templier Avatar answered Oct 04 '22 12:10

Thierry Templier