Git Product home page Git Product logo

Comments (5)

PatrickHeneise avatar PatrickHeneise commented on July 4, 2024

app is defined in your index.js from Cordova/Phonegap.

from angular-phonegap-push-notification.

maxdec avatar maxdec commented on July 4, 2024

Is it the navigator.app variable? I don't have any global app variable too, but navigator.app is defined.

from angular-phonegap-push-notification.

PatrickHeneise avatar PatrickHeneise commented on July 4, 2024

It's not navigator.app, it's app from index.js (which comes with Cordova/Phonegap) and should be loaded before.

from angular-phonegap-push-notification.

hiniesta avatar hiniesta commented on July 4, 2024

As Maxdec has said, congratulations.

Buy I have the same error. I'm using angularjs + cordova + ionic and can't find the declaration of the variable. Any help?

EDIT: I presume is something like this:
var app = {
// Application Constructor
initialize: function() {
this.bindEvents();
},
// Bind Event Listeners
//
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
// deviceready Event Handler
//
// The scope of 'this' is the event. In order to call the 'receivedEvent'
// function, we must explicitly call 'app.receivedEvent(...);'
onDeviceReady: function() {
app.receivedEvent('deviceready');
},
// Update DOM on a Received Event
receivedEvent: function(id) {
var parentElement = document.getElementById(id);
var listeningElement = parentElement.querySelector('.listening');
var receivedElement = parentElement.querySelector('.received');

    listeningElement.setAttribute('style', 'display:none;');
    receivedElement.setAttribute('style', 'display:block;');

    console.log('Received Event: ' + id);
}

};

app.initialize();

from angular-phonegap-push-notification.

PatrickHeneise avatar PatrickHeneise commented on July 4, 2024

Exactly that.

from angular-phonegap-push-notification.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.