How to run function without stuck the UI in ionic (2)

Hi
I try to run a recorsive function without stuck app’s UI any help please

Thanks