Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fxLayoutWrap not working

I've got these blocks of codes

<div fxLayout="row" fxLayoutGap="1em" fxLayout.lt-md="column" fxLayoutWrap>
    <div *ngFor="let post of posts; let i=index" >
         <div *ngIf = "i%3===0" fxFlex="90%" fxFlex.lt-md="100%">
             <!--Some code-->
         </div>
         <div *ngIf = "!(i%3===0)" fxFlex="40%" fxFlex.lt-md="100%">
             <!--Some other code-->
         </div>
    </div>
</div>

I want the stuff to be on the same row when I use fxFlex="40%" However, they appear on different rows

like image 418
Yiyue Wang Avatar asked Dec 08 '17 00:12

Yiyue Wang


3 Answers

https://github.com/angular/flex-layout/blob/cb0beab46507aa50c513aca8bb6ef632c397035c/CHANGELOG.md#breaking-changes

fxLayoutWrap has been removed. You can use fxLayout options.

<div  fxLayout="row wrap"> ... </div>
like image 96
cihangir zengin Avatar answered Oct 21 '22 00:10

cihangir zengin


flex-layout 6.0.0-beta.16, since fxLayoutWrap directive has been deprecated in this version

<div fxLayout="column" fxLayoutAlign=" none">
  <div fxFlex="100" fxLayout="row wrap" fxLayoutAlign="space-around stretch" fxLayout.xs="column">
    <div *ngFor="let item of items | async" fxFlex.xs="100" fxFlex.sm="50" fxFlex.md="33" fxFlex.lg="33" fxFlex.xl="33">
     {{item}}
    </div>
  </div>
</div>
like image 29
Uliana Pavelko Avatar answered Oct 20 '22 23:10

Uliana Pavelko


fxLayoutWrap: * [fxLayoutWrap] was deprecated in earlier betas. fxLayoutWrap has now been removed. Developers should use fxLayout options.

Before

<div  fxLayout="row" fxLayoutWrap="wrap"> ... </div>

current

<div  fxLayout="row wrap"> ... </div>
like image 30
Abdul Khalik Avatar answered Oct 21 '22 01:10

Abdul Khalik