I have a "bootstrapModal" attribute directive that adds bootstrap attributes to the host element:
data-placement="top" data-toggle="modal" data-target="#DefaultModalWindow"
Is it possible to HostBinding
to an attribute like this?
<htmltag ... bootstrapModal placement="left">
And in the directive have something like that:
@HostBinding('attributes.data-placement') // <== this don't work
@Input() placement:string='top';
So the result should be:
<htmltag ... data-placement="left" data-toggle="modal" data-target="#DefaultModalWindow">
This should work:
@HostBinding('attr.data-placement')
Plunker
See also
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With