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

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -