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
Post a Comment