Skip to content

Instantly share code, notes, and snippets.

@jgabriellima
Created February 17, 2016 04:09
Show Gist options
  • Save jgabriellima/322bda230b7aacdb6c30 to your computer and use it in GitHub Desktop.
Save jgabriellima/322bda230b7aacdb6c30 to your computer and use it in GitHub Desktop.
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