有条件地添加/删除 fxLayout 和 fxLayoutAlign 属性
Posted
技术标签:
【中文标题】有条件地添加/删除 fxLayout 和 fxLayoutAlign 属性【英文标题】:Add/remove fxLayout and fxLayoutAlign properties conditionally 【发布时间】:2021-12-28 04:14:32 【问题描述】:我正在尝试在我的 div 中有条件地添加/删除 fxLayout
和 fxLayoutAlign
属性
<div *ngIf="name === 'A'" fxFlex="50%" fxLayout="row" fxLayoutAlign="start center">
...
</div>
这样的事情对我不起作用
fxLayoutAlign="myCondition? 'start center' : ''"
有什么我可以尝试的想法吗?
【问题讨论】:
我们可以在这个平台之外连接吗? 【参考方案1】:你需要这样使用..
[fxLayoutAlign]="someCondition ? 'start center' : ''"
演示在这个Stackblitz
【讨论】:
以上是关于有条件地添加/删除 fxLayout 和 fxLayoutAlign 属性的主要内容,如果未能解决你的问题,请参考以下文章