Angular 4: Conditional Styling on Mouseover (part6)

[ngStyle] can be used to style an element on mouseover like this with the ternary operator,

<div (mouseover)="hover=true" (mouseleave)="hover=false">
<span [ngStyle]="{backgroundColor: hover==true  ? 'lightgrey' : 'grey' }">hello {{ hover }}</span>
</div>