I have a the following sample.ts:
class Sample {
var1;
var2;
...
}
export default new Sample();
In another class, i imported it using:
import sample from './sample';
And use it as:
sample.var1;
But I would like to access var2 without using sample.var2
. I thought of exporting var2
as well, but I'm not sure if that is possible. I want something like below, so I can use var2
directly when i import the file.
class Sample {...}
export default new Sample(), var2;