Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ionic-alerts
'use strict';
/**
* @ngdoc function
* @name app.service:API
* @description
* # API
*/
angular.module('app').service('Alerts', function($ionicLoading, $ionicPopup, $http, $ionicHistory, $location) {
return {
default: function(scope_, title_, template_, btn, callback) {
var myPopup = $ionicPopup.show({
template: template_,
title: title_,
scope: scope_,
buttons: [{
text: '<b>' + btn + '</b>',
type: 'btn btn-default',
onTap: function(e) {
callback();
}
}]
});
},
confirm: function(scope_, title_, template_, buttons_) {
$ionicPopup.show({
template: template_,
title: title_,
scope: scope_,
buttons: buttons_
});
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment