salah
salah

Reputation: 1

Angular component use own module and pass data to child component in app module

I have parent component with it's own module and pass data to child component that imported in app-module by using @input but there is error

*Can't bind to 'courseId' since it isn't a known property of 'app-rate-course'.

  1. If 'app-rate-course' is an Angular component and it has 'courseId' input, then verify that it is part of this module.
  2. If 'app-rate-course' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
  3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.*

Upvotes: 0

Views: 482

Answers (2)

Renjith P N
Renjith P N

Reputation: 4251

Have you exported the component in module.ts file.

exports: [
    FeatureComponent
]

Upvotes: 0

surjendu_dey
surjendu_dey

Reputation: 588

Import the child component in app.module.ts and add it to the declarations array

Upvotes: 0

Related Questions