我有这个代码,这里当屏幕尺寸大于小时,layout-align运行良好,但是当它小于小时,布局对齐不起作用
<div layout-gt-sm="row" layout-lt-sm="column" flex layout-align="space-around center">
<!-- main content like jokes and news will go here -->
<div flex-gt-sm="55" flex="80">
<md-card class="md-whiteframe-5dp">
hello</md-card>
</div>
<!-- todo and upcoming event will go here -->
<div flex-gt-sm="35" flex="80">
<div>
<ng-include src="'templates/dashboard/todo.html'"></ng-include>
</div>
<div>
<ng-include src="'templates/dashboard/todo.html'"></ng-include>
</div>
</div>
</div>
感谢
答案 0 :(得分:1)
Angular Material不再提供layout-lt-*
指令。相反,你应该这样做:
<div layout="column" layout-gt-sm="row">
这可能导致布局对齐指令无效,因为它们目前在代码中没有父布局。
您可以在此处阅读更多内容:https://material.angularjs.org/HEAD/layout/container