What is @Input() used for in Angular?

后端 未结 4 1471
一生所求
一生所求 2021-01-31 13:46

I was studying the Create a feature component tutorial on angular.io and then I noticed the @Input decorator property:



        
4条回答
  •  南笙
    南笙 (楼主)
    2021-01-31 14:40

    @Input() hero means that hero is a variable that is being passed on to this component from it's parent.e.g

     
    

    Here I am passing hero object to hero detail component from it's parent component.

提交回复
热议问题