【发布时间】:2016-02-28 00:18:39
【问题描述】:
所以我在角度工厂函数中定义了我的类:
export default function ($resource, $http:angular.IHttpService) {
return class Account{}
}
我还有一个 all.ts,其中包括了我的肯定类型。当我想在另一个类中使用 Account 时,我将其注入:
class AccountsController {
public static $inject = ['Account'];
constructor(public Account:Account){}
}
但是,Account 是未知的,即使我将工厂文件添加到 all.ts 引用,它也找不到它。
我怎样才能让打字稿知道 Account,理想情况下无需再次定义接口(因为它已经通过类定义了,不是吗?)。
【问题讨论】:
标签: angularjs typescript