Skip to content

Commit

Permalink
Added existing phonegapReady as dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Heneise committed Jan 25, 2014
1 parent e2e546e commit 73c3485
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
6 changes: 5 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-phonegap-push-notification",
"version": "0.0.1",
"version": "0.0.2",
"homepage": "https://github.com/PatrickHeneise/angular-phonegap-push-notification",
"authors": [
"Patrick Heneise <mail@patrickheneise.com>"
Expand All @@ -20,6 +20,10 @@
"gcm",
"apn"
],
"dependencies": {
"angular": "~1.0.5",
"angular-phonegap-ready": "~0.0.1"
},
"license": "MIT",
"ignore": [
"**/.*",
Expand Down
17 changes: 3 additions & 14 deletions push.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,20 @@
/*
* angular-phonegap-push-notification v0.0.1
* angular-phonegap-push-notification v0.0.2
* (c) 2014 Patrick Heneise, patrickheneise.com
* License: MIT
*/

'use strict';

angular.module('phonegap', [])
angular.module('phonegap',
['btford.phonegap.ready'])
.service('phone', function () {
this.isAndroid = function () {
var uagent = navigator.userAgent.toLowerCase();
return uagent.search('android') > -1 ? true : false;
};
})

.factory('phonegapReady', function ($rootScope, $q) {
var loadingDeferred = $q.defer();

document.addEventListener('deviceready', function () {
$rootScope.$apply(loadingDeferred.resolve);
});

return function phonegapReady() {
return loadingDeferred.promise;
};
})

.factory('push', function ($rootScope, phone, phonegapReady) {
return {
registerPush: function (fn) {
Expand Down

0 comments on commit 73c3485

Please sign in to comment.