How to show Ionic Loader in Android

I want to check internet connection and after checking internet want to go another page. at the time of network checking i want to show a loading indicator. Now im having one But i can only show it while pressing a button.i nned to show with out button and go to next page