OpenFB
OpenFB copied to clipboard
How do I transform openfb on a Require module?
A try twice and no success.
Did you see it https://github.com/ccoenraets/OpenFB/pull/6 ?
No, thanks!
hi @icaro56 , @fernandojunior
I was able to convert this plugin into a require JS module
I am using backbone JS with requireJS.
I bootstrapped my app when I received deviceReady event and inside this event handler i assigned runningInCordova variable to the window object.
for example:
require(["baseLib"], function(argument) {
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
window.runningInCordova = true;
//rest of the app Initialization code goes here
}
});
Once this is done, you may go ahead and directly use this requireJS module from this fiddle.
https://jsfiddle.net/jatin_maini/fb8n2wqt/
hope that helps
- Jatin