OpenFB icon indicating copy to clipboard operation
OpenFB copied to clipboard

How do I transform openfb on a Require module?

Open icaro56 opened this issue 10 years ago • 3 comments

A try twice and no success.

icaro56 avatar Nov 18 '14 16:11 icaro56

Did you see it https://github.com/ccoenraets/OpenFB/pull/6 ?

fernandojunior avatar Nov 19 '14 16:11 fernandojunior

No, thanks!

icaro56 avatar Nov 19 '14 17:11 icaro56

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

jatin-Maini avatar May 07 '16 20:05 jatin-Maini