I am confused about passing a value in the constructor using a singleton class in TypeScript.
mycode .ts
import {singleton} from "tsyringe";
@singleton()
class Bar {
constructor(value: string)
{
this.value = value
}
}
// another file
import "reflect-metadata";
import {container} from "tsyringe";
import {Bar} from "./bar";
const obj = container.resolve(Bar);
Can someone provide an example code on how to pass a value in the constructor using the constainer .resolve function?