我是打字稿的新手,并停留在以下代码中。 这是我的代码
private basketsource = new BehaviorSubject<IBasket>(null);
getcurrentBasketvalue(): IBasket {
return this.basketsource.value;
}
并且我想在篮子变量中以返回类型“ IBasket ”获取其值。见下文
const basket = this.getcurrentBasketvalue;
但它返回类型 ' () => IBasket '。
注意:IBasket 是一个接口
请帮帮我,我该怎么办?如果有人解决了这个问题,我将不胜感激。 提前致谢...