on mousehover在Angular 2/4中显示和隐藏div

时间:2018-04-26 10:05:25

标签: angular

使用Angular2在鼠标悬停时显示和隐藏div,我们如何在Angular2中鼠标悬停时显示和隐藏div。

1 个答案:

答案 0 :(得分:2)

<div (mouseover)="show = true" (mouseout)="show = false">Hello DIV</div>

<div *ngIf='show'>DIV to show/hide</div>

Working Example