【问题标题】:Add/remove fxLayout and fxLayoutAlign properties conditionally有条件地添加/删除 fxLayout 和 fxLayoutAlign 属性
【发布时间】:2021-12-28 04:14:32
【问题描述】:

我正在尝试在我的 div 中有条件地添加/删除 fxLayoutfxLayoutAlign 属性

<div *ngIf="name === 'A'" fxFlex="50%" fxLayout="row" fxLayoutAlign="start center"> 
...
</div>

这样的事情对我不起作用

fxLayoutAlign="myCondition? 'start center' : ''"

有什么我可以尝试的想法吗?

【问题讨论】:

  • 我们可以在这个平台之外连接吗?

标签: angular angular-flex-layout


【解决方案1】:

你需要这样使用..

[fxLayoutAlign]="someCondition ? 'start center' : ''"

演示在这个Stackblitz

【讨论】:

    猜你喜欢
    • 2019-07-19
    • 2021-06-26
    • 2017-04-28
    • 2020-03-25
    • 2020-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-14
    相关资源
    最近更新 更多