Created
February 17, 2016 04:09
-
-
Save jgabriellima/322bda230b7aacdb6c30 to your computer and use it in GitHub Desktop.
ionic-alerts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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