I would like to have a dynamic grid system so trying to use conditional css but it’s failing for the moment. I have seen Josh Morony video with his button example:
<button ion-button [outline]="true">Test</button>
When I try to do this: <ion-col [width-80]="isTrue">Test</ion-col>
I am getting the following error:
Unhandled Promise rejection: Template parse errors:
Can’t bind to ‘width-80’ since it isn’t a known property of ‘ion-col’.
If ‘ion-col’ is an Angular component and it has ‘width-80’ input, then verify that it is part of this module.
If ‘ion-col’ is a Web Component then add “CUSTOM_ELEMENTS_SCHEMA” to the ‘@NgModule.schemas’ of this component to suppress this message.
// getDeviceType() can call Platform class from Ionic 2 or even get window width to make calculations to check the device type. It must return a string "desktop", "tablet" or "phone"
<div class="{{ getDeviceType() }}" style="width: 100%;">
<div grid style="width: 100%;">
<div col-phone = "12"
col-tablet = "4"
col-desktop = "3"
*ngFor = "let item of myProvider.itens">
<ion-card>
<ion-list>
<ion-item>
<ion-icon item-left [name]="item.icon"></ion-icon>
<b>{{ item.name }}</b>
<b>{{ item.content }}</p>
</ion-item>
</ion-list>
</ion-card>
</div>
</div>
</div>