angular - Angular2 attribute directive Hostbinding to host attribute -


i have "bootstrapmodal" attribute directive adds bootstrap attributes host element:

data-placement="top" data-toggle="modal" data-target="#defaultmodalwindow" 

is possible hostbinding attribute this?

<htmltag ... bootstrapmodal placement="left"> 

and in directive have that:

 @hostbinding('attributes.data-placement') // <== dont work  @input() placement:string='top'; 

so result should be:

<htmltag ... data-placement="left" data-toggle="modal" data-target="#defaultmodalwindow"> 

this should work:

@hostbinding('attr.data-placement') 

plunker

see


Comments