Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Declaring the inputs property within the Angular @Component Decorator?

I’m studying the Angular Material Button code and I noticed that within the @Component there a declared inputs property.

What is this for? The description says:

inputs – list of class property names to data-bind as component inputs

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

So I assume it’s complementary to the @Input() property declarations … But I’ve never seen it used anywhere else, so just curious why they are declaring it?

>Solution :

it is indeed the same thing as marking your input as @Input(), all of the components metadata (such as HostBinding, Output, ….) can be described in the @Component decorator, but the decorator way is usually the preferred one.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading