so I have this simple code:
var UI = require('ui');
var numero = 1;
setInterval(function(){
var main = new UI.Card({ body: numero });
numero++;
main.show();
}, 1000);
I want to do the same without calling a new card, how can I do this? In a simpler way
This is what you want:
In your original code, every time setInterval would run you would define a new card and display it on top of whatever was already displayed. What you want to do instead is define the card first, then on each successive iteration you can update that one card's body.
Notice that you do not need to have
main.show();
to update the display. By changing the body text, the display is updated.