Hi Sander,

Thanks for your reply.

So, I'm currently trying out Angular with Cordova. Cordova triggers a 
"deviceready" event after initialization is complete and I'm manually 
bootstrapping Angular in the event handler to make sure Cordova is fully 
initialized before any other application or Angular code is executed.

The app renders an initialization status text for the user using an Angular 
expression. When the event is triggered I'm updating a status variable in 
the Angular model. Here's the original sample app code that I'm 

https://github.com/apache/cordova-app-hello-world/blob/master/www/js/index.js

and here's how I've modified it:

onDeviceReady: function() {

// manually bootstrap Angular after Cordova is ready.

angular.bootstrap(document, ['helloApp']);

app.receivedEvent('deviceready');

},
receivedEvent: function(id) {

// update Angular model

angular.element(document.getElementById("deviceready")).scope().$apply(function(scope)
 
{

scope.deviceStatus = "Device is Ready (ng)";

scope.deviceInfoClass = ['event', 'received'];

});

}

 
Is there a better way to solve this?


best regards,

marko

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to