How to use ionic spinner from class

How to use ionic spinner from class.I need to make a web service call.For example when user click in login,i will call web service at that time i need to start the spinner.If the user is valid i need to move the user to next page and then load all data in second page and then stop the spinner.In Ionic 1,i used to do this-

// StartSpin 
StartSpin:function () {
  $ionicLoading.show({
    template: '',
    animation: 'fade-in',
    showBackdrop: true,
  });
},

// StopSpin
StopSpin:function () {
  $ionicLoading.hide();
}