Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 229111

Want to create a text animation in Ionic

$
0
0

So I have a text value attribute in my html. Something like this:

{{value}}

I want to do a type of countdown changing the value each time so I wrote some javascript in the component to change the value before arriving at the final value (so 5..4..3..2..etc.):

countdown(){

this.value = 5;
this.value = 4;
this.value = 3;
}

The JavaScript executes, but the value is changing so quickly that the view doesn't update until after the method finishes. Is there a better way to do this? Can I force the redraw between values being set or is there some kind of async code I should be using?


Viewing all articles
Browse latest Browse all 229111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>