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
// Requires the Toast plugin: https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin | |
// And Ionic Framework: http://ionicframework.com | |
// ngCordova is used here, but easily removed: http://ngcordova.com/ | |
// When running in Cordova, show the native toast. Outside of Cordova, show an Ionic Popup for the same period of time. | |
// Uses the API for the Toast plugin - message, duration, position. | |
// Differences are that: Ionic Popup ignores position, and doesn't allow doing anything while it shows. | |
.factory('Toast', function($rootScope, $timeout, $ionicPopup, $cordovaToast) { | |
return { | |
show: function (message, duration, position) { |