隐藏 Angular 2 材质工具提示,如 ngIf [英] Hide Angular 2 material tooltip like ngIf
本文介绍了隐藏 Angular 2 材质工具提示,如 ngIf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 Angular 1 Material 中,我可以使用指令,现在它是一个属性,现在很难做到.我怎样才能做到只在页面宽度较小时仅显示工具提示并在页面宽度较大时隐藏?
In Angular 1 Material I could use a directive, right now it is an attribute, right now it is very hard to do. How can I do it simply to only show the tooltip like when the width of page is small and hide when it is big?
我找不到.不可能使用像:
I cannot find. It is not possibly to use like:
<md-tooltip ngIf="false">sometimes hidden</md-tooltip>
推荐答案
如果我正确理解您的请求,您希望仅在满足特定条件时显示工具提示,请尝试以下操作:
If I understand your request correctly you want to show tooltip only when a certain condition is met, try this:
<div [matTooltip]="isWide ? 'Visible' : null"></div>
这篇关于隐藏 Angular 2 材质工具提示,如 ngIf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文