Dynamically mount angular 2 directive [duplicate]

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 17:48:27

Adding or removing directives dynamically is not supported. Only components can be added and removed dynamically (only dynamically added components can be removed dynamically).

You do not add or remove directives dynamically, but if you want to add a tooltip you have to insert a div in your component template that activates it depending on a variable status

<div [hidden]="tooltipnotshown"
     class="tooltip">
 blah blah or whatever ...
</div>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!