๐๐๐๐ข๐ง๐ข๐ญ๐ข๐จ๐ง
Input ( @๐๐ง๐ฉ๐ฎ๐ญ() ) is one of the most used decorators in Angular apps.ย
It is used to pass data from the parent or host component to the child component.
This decorator has a relation with DOM property in the template where the child component is used.
๐๐ง๐ข๐ฉ๐ฉ๐๐ญ
To define an input for a component, use the @๐๐ง๐ฉ๐ฎ๐ญ ย decorator.
For example if one component needs a user argument to render information about that user:
๐ add an @๐๐ง๐ฉ๐ฎ๐ญ binding to user:๐๐๐
๐ญ. ๐๐ผ๐บ๐ฝ๐ผ๐ป๐ฒ๐ป๐'๐ ๐ฐ๐ผ๐ป๐๐ฟ๐ผ๐น๐น๐ฒ๐ฟโฌ๏ธโฌ๏ธโฌ๏ธ
๐๐๐๐๐๐ก { ๐ถ๐๐๐๐๐๐๐๐ก, ๐ผ๐๐๐ข๐ก } ๐๐๐๐ '@๐๐๐๐ข๐๐๐/๐๐๐๐'; @๐ถ๐๐๐๐๐๐๐๐ก({ ๐ ๐๐๐๐๐ก๐๐: '๐ข๐ ๐๐-๐๐๐๐๐๐๐' ๐ก๐๐๐๐๐๐ก๐: '{{๐ข๐ ๐๐.๐๐๐๐}}' }) ๐๐ฅ๐๐๐๐ก ๐๐๐๐ ๐ ๐๐ ๐๐๐๐๐๐๐๐๐ { @๐๐ง๐ฉ๐ฎ๐ญ() ๐ข๐ ๐๐; ๐๐๐๐ ๐ก๐๐ข๐๐ก๐๐() {} }
ย ๐ฎ. ๐ฃ๐ฎ๐ฟ๐ฒ๐ป๐ ๐ฐ๐ผ๐บ๐ฝ๐ผ๐ป๐ฒ๐ป๐'๐ ๐๐ฒ๐บ๐ฝ๐น๐ฎ๐๐ฒโฌ๏ธโฌ๏ธโฌ๏ธ
<๐ข๐ ๐๐-๐๐๐๐๐๐๐ ๐ข๐ ๐๐="bob">