How can we use Phonegap with require js ? I am try to add to phonegap using the require() method. My code is given below and all .js files are in the correct location. Please help me, it is able to load phonegap via AMD , or Use Normal script method like
<script type="text/javascript" src="cordova.js"></script>
this is my require config and methods
require.config({
baseUrl: 'js/lib',
paths: {
controller: '../controller/controller',
model: '../model/model',
view: '../view/view',
router:'../router/router'
},
/* map: {
'*': {
'tempName': 'actualName'
}
},*/
shim: {
'backbone': {
deps: ['underscore', 'jquery','cordova'],
exports: 'Backbone'
},
'underscore': {
exports: '_'
}
}
});
require(['jquery', 'backbone', 'router', ], function ($, Backbone, Router) {
document.addEventListener('deviceready', function () {
alert('hi'); // working
navigator.notification.alert('hi'); // not working
}, false);
});