Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adding directive to a angular 2 component

I recently created a simple project using angular 2. When I try to add a directive component to the app.component, there's a red underline for 'directives' property. Anybody tell me what's wrong here?

enter image description here

like image 525
Rozane Avatar asked Jan 30 '17 08:01

Rozane


1 Answers

Directives, components, and pipes need to be added to

@NgModule({
  declarations: [...]

since RC.6

directives, and pipes was removed from @Component() back then.

like image 183
Günter Zöchbauer Avatar answered Oct 08 '22 07:10

Günter Zöchbauer