Angular: Bind to an @Input alias

后端 未结 4 1365
一整个雨季
一整个雨季 2021-02-06 22:21

I\'m trying to set an input alias in a directive following this example

  @Input(\'appAvatarColor\') name: string;

The program is working, but

4条回答
  •  庸人自扰
    2021-02-06 22:47

    You should rename @Input('appAvatarColor') name: string; to something else for this to differ from the directive name. You can do @Input('avatarColor') name: string; and then simplify it by @Input() avatarColor: string;

提交回复
热议问题