#Help update outdated host metadata property

3 messages · Page 1 of 1 (latest)

minor kayak
#

I'm adapting this custom form component from the official angular guides https://material.angular.io/guide/creating-a-custom-form-field-control, and ESLint tells me the host metadata property should be updated to @ HostBinding or @ HostListener. I'm having problems understanding what it does and how I am supposed to change it to @ HostBinding for example.

host: {
'[class.example-floating]': 'shouldLabelFloat',
'[id]': 'id',
},

#

Help update outdated host metadata property

winter moth
#

All you need to do is to decorate your shouldLabelFloat property with @HostBindingt('[class.example-floating])` (and do the same thing with the id property)