Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>That error is definitely what it says: your cordova.js file is not being included correctly. Fix that first.</p> <p>To answer your larger question: Angular, jQuery Mobile, and PhoneGap will play together but it comes with some big caveats.</p> <p>The biggest issue is that the jQuery Angular Mobile adapter is currently abandoned while they invest time in building a better solution: angular-jqm. That means that the adapter only works with outdated versions of the libraries.</p> <p>Second: those outdated library versions have some issues working with Windows Phone. These are fixable, too, but lock you into an even less maintainable version of them.</p> <p>So here is the setup:</p> <pre><code>&lt;script src="javascripts/vendor/jquery-mobile-1.3.1.js"&gt;&lt;/script&gt; &lt;!-- this angular-1.0.6 includes a patch to support WP8 URLs: https://github.com/angular/angular.js/issues/2303 --&gt; &lt;script src="javascripts/vendor/angular-1.0.6.js"&gt;&lt;/script&gt; &lt;script src="javascripts/vendor/jquery-angular-mobile-adapter-1.3.2.js"&gt;&lt;/script&gt; </code></pre> <p>Unfortunately I was never able to get partials to load via XHR so I included all pages in index.html document.</p> <pre><code>&lt;body ng-controller="AppController"&gt; &lt;div data-role="page" id="first" ng-controller="FirstController"&gt; &lt;h1&gt;First Page&lt;/h1&gt; &lt;p&gt;{{foo}}&lt;/p&gt; &lt;p&gt;&lt;a href="#/second"&gt;Second Page&lt;/a&gt;&lt;/p&gt; &lt;/div&gt; &lt;div data-role="page" id="second" ng-controller="SecondController"&gt; &lt;h2&gt;Second Page&lt;/h2&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p>Then you need to switch off a few niceties in the JavaScript and set up your routes:</p> <pre><code>&lt;script&gt; var so_example = angular.module('so_example', []). config(function ($routeProvider, $locationProvider, $compileProvider) { // turn off html5 mode so that we just navigate around using hashes $locationProvider.html5Mode(false).hashPrefix(""); // allow for the odd URLs included in Windows Mobile PhoneGap $compileProvider.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|tel|x-wmapp0):/); $routeProvider. when('/second', { templateUrl: '#second', jqmOptions: { transition: 'slide' } }). when('/', { templateUrl: "#first" }); }). controller("FirstController", function ($scope) { $scope.foo = "Hello, World!"; }). controller("SecondController", function ($scope) { }); &lt;/script&gt; </code></pre> <p>Now you need to leverage the Cordova library before you bootstrap Angular to your HTML:</p> <pre><code>var app = (function () { function onDeviceReady() { angular.bootstrap(document, ['so_example']); $.mobile.phonegapNavigationEnabled = true; } return { initialize: function() { document.addEventListener('deviceready', onDeviceReady, false); } }; })(); app.initialize(); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload