What is @Input() used for in Angular?

后端 未结 4 1463
一生所求
一生所求 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:39

    Simply, by using the input decorator you are telling angular that a variable named hero will take Hero object as input from 'HeroDetailComponent' and will be able to pass this Hero object to any of its child component. This is called Input Binding

提交回复
热议问题