6

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

1 Answer 1

9

Directives, components, and pipes need to be added to

@NgModule({
  declarations: [...]

since RC.6

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

Sign up to request clarification or add additional context in comments.

6 Comments

@echonax - Is this the official one?
@Günter - Thank you very much. I didn't know that. Sorry I can't vote up any of your answers since I don't have 15 reputations.
@Rozane yes it is the official changelog. If Günter's answer helped you, you should mark his answer as accepted :-) meta.stackexchange.com/a/135826
@Rozane yes, it's the official. No worries.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.