I have a simple directive which selector is an img.
@Directive(
{ selector: 'img' }
)
export class ImageDirective {
...
}
How can I add boolean parameter to this directive? I tried it with
@Input() enabled: boolean = false;
html part:
<img [enabled]="true"
but it does not work, does'nt matter what I set, the this.enabled remains false;
Thanks
you should change your code: in the directive change your selector:
in the html change to
Follow the explanation on directive