Skip to content

Instantly share code, notes, and snippets.

@lakshmig
Created November 4, 2014 05:55
Show Gist options
  • Save lakshmig/94c17b7cd9478fada80f to your computer and use it in GitHub Desktop.
Save lakshmig/94c17b7cd9478fada80f to your computer and use it in GitHub Desktop.
Angular Device Ready for Ionic with Cordova
// Copy below code at the begining of app.js
var ngDocument = angular.element(document);
angular.element(ngDocument).ready(function() {
alert()
ngDocument.on('deviceready', function() {
alert("inside device ready");
var body = ngDocument.find('body');
angular.bootstrap(body, ['starter']);
});
});
angular.module('starter', ['ionic' ,'starter.controllers', 'starter.services','ngCordova'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment