setTimeout and setInterval not working


#1

I’m trying to use the “setInterval()” and “setTimeout()” functions in my project. I used them in ngOnInit and in the constructor. My code only runs once no matter where I put it.

Ionic Framework: 2.0.0-rc.3
Ionic Native: 2.2.3
Ionic App Scripts: 0.0.46
Angular Core: 2.1.1
Angular Compiler CLI: 2.1.1
Node: 6.9.1
OS Platform: Windows 10
Navigator Platform: Win32


#2

setTimeout only runs once by design. setInterval should work fine; example: http://plnkr.co/edit/nZ3sZX?p=preview