Hello guys, i’m trying to figure out how to create in the smartest way ionic card dynamically from javascript.
At the moment i’m doing with these bunch of rows:
let card = document.createElement("ion-card");
let cardContent = document.createElement("ion-card-content");
let cardTitle = document.createElement("ion-card-title");
let row = document.createElement('ion-row');
let ionButton = document.createElement('ion-button');
let icon = document.createElement('ion-icon');
icon.slot = 'icon-only';
icon.name = 'expand-outline';
ionButton.color = 'light';
ionButton.append(icon);
cardTitle.append(ionButton);
cardContent.append(row);
card.append(cardTitle);
card.append(cardContent);
I supposed there is a faster way like:
let card = new IonCard({
// options to complete the card like ion-card-header, ion-card-content and stuff like that
})
But i’m wrong.
Any tips?
Thx guys