Roman Sedov
Jun 22, 2021

--

You can also implement it in the following way:

@Directive({ selector: '[applyColor]'})export default class ApplyColorDirective {  @Input()  @HostBinding('style.backgroundColor')  applyColor: string;}

--

--

Roman Sedov
Roman Sedov

Written by Roman Sedov

Angular Google Developer Expert

No responses yet