javascript - meteor import global variable how? -


hello using meteor 1.3.5

i have package in:

projectdir/packages/mypackage 

in package defined global variable:

myglobalvariable = "somedata"; 

now have myapi.js in:

projectdir/imports/api/myservice 

i want use myglobalvariable in myapi.js. included line:

import {myglobalvariable} 'meteor/mypackage'; 

in code global variable still undefined when enter code in myapi.js.

what doing wrong?

you can kept global variable inside lib/constant.js here able access

any files placed in folder lib/ anywhere in app structure loaded before every other file

lib/constant.js

myglobalvariable = "somedata"


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -