I have several utility functions. What is the best way to package these up, and then import them?
This is what I am trying to do:
import * as util from './util'
export class myClass{
constructor()
{
util.doSomething("test");
}
}
Then in the class:
export class Util{
doSomething(val: string){ return val;}
doSomethingElse(val: string{ return val;}
}
The error message I get from VS is:
Property doSomething does not exist on type util.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…