是否可以使用以下命令控制具有角度材料2的元素的可见性
hide-xx show-xx hide-gt-xx show-gt-xx我知道这与angularJS-material一起工作。
以下代码不起作用:
<md-toolbar color="primary">
<span>Application Title</span>
<span class="example-fill-remaining-space"></span>
<button md-button hide-xs show-gt-xs>Auto hide button</button>
</md-toolbar>我使用https://github.com/angular/material2版本2.0.0-beta1
如果否,是否有其他方法可以做到这一点,而不使用*ngif和屏幕大小调整侦听器,或其他css框架,如Bootstrap?
顺便问一下,https://github.com/angular/flex-layout也有这种可能性吗?
发布于 2017-01-31 19:07:49
我推荐你已经提到的@angular/flex-layout,!
这是一个额外的软件包-需要安装,它不是angular的一部分!
可能的选项:
用法:
<div fxFlex="60" fxHide.xs></div>现场演示:https://plnkr.co/edit/yrhaGtFpHOlYYOTqzDDO?p=preview
此处提供的文档:
https://github.com/angular/flex-layout/wiki/API-Documentation
https://stackoverflow.com/questions/41955962
复制相似问题