Ionic grid how to set col-x programmatically


#1

let’s say I have a matrix to display with ionic grid.
I would apply ionic grid col width dinamically depending on the column content.

 <ion-grid>   
    <ion-row *ngFor="let row of matrix">
      <ion-col *ngFor="let val of row; let i = index"
               [ngClass]="columnsWidth[i]" >
        {{val}}
      </ion-col>
    </ion-row>
  </ion-grid>

Where columnsWidth is an array with size the number of matrix columns,
for istance if matrix is 3X3, columnsWidth = ['col-2','col-8','col-4']

The result html col element attribute contains col-x but it’s not applied, how can I make it work?
Thanks