Ionic Angularjs – Sweetalert not running function-open source projects t4t5/sweetalert

I have used SweetAlert before with success but today I tried using it with Ionic and I have a problem. When I use it like this it executes the something function but it’s not waiting for the confirm button to be pressed:

$scope.something=function(){console.log('test')};
swal({title: 'True',text: '',type: 'success',confirmButtonText: 'Next' },$scope.something());

When I use it like this, it’s not working at all:

swal({title: 'True',text: '',type: 'success',confirmButtonText: 'Next' },function(){console.log('test')});

Any ideas?