cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CB-10522) Event binding in Hello World is misleading
Date Tue, 09 Feb 2016 06:15:18 GMT


ASF GitHub Bot commented on CB-10522:

Github user dblotsky commented on a diff in the pull request:
    --- Diff: www/js/index.js ---
    @@ -19,22 +19,20 @@
     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);
    --- End diff --
    Any variables in `app`'s scope are already in `onDeviceReady`'s scope.

> Event binding in Hello World is misleading
> ------------------------------------------
>                 Key: CB-10522
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: App Hello World
>            Reporter: Richard B Knoll
>            Assignee: Sarangan Rajamanickam
>            Priority: Minor
>              Labels: triaged
> It is our recommendation that you bind to all of the Cordova events ({{pause}}, {{resume}},
etc.) in your {{deviceready}} callback so as to ensure that cordova.js and all your plugins
are done being loaded. This is mentioned in the events guide [in the documentation|]
> However, we include a {{bindEvents}} method in the template which implies that all event
binding should happen there. We should probably just remove {{bindEvents}} altogether and
add the event listener for {{deviceready}} in the {{initialize}} method since the other events
we mention seem to be out of date. We should also add a comment explaining where Cordova related
events should be bound to.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message