Q:

Angular 2 ngFor conditional placement

In my angular 2 app I have array with some items and would like to put each item to specific place depending on condition.
This is example template:
<div>
  <div>_place if 1 condition</div>
  <div>_place if 2 condition</div>
  ...
  <div>_place if n condition</div>
</div>

So, I would like to put array items to 1 place if 1 condition, to 2 place if 2 ... to n if n.
Is there way to do this with ngFor or some else?

A:

Yes, I would filter the array! In ngOnInit() set variables equal to the result of each filter. This will sort the values of a single array into multiple arrays based on conditions in the filter. 
ngOnInit(){
    let div1Values = this.records.filter((item) => {
            return (item.CustomerKey === 0? item : null);
    })
    let div2Values = this.records.filter((item) => {
            return (item.IsActive? item : null);
    })
}

Then bind to these new arrays in the template:
<div>
  <div *ngFor="let record of div1Values">{{record}}</div>
  <div *ngFor="let item of div2Values">{{item}}</div>
  ...
  <div *ngFor="let value of divNValues">{{value}}</div>
</div>

