【发布时间】:2015-11-30 19:57:51
【问题描述】:
TypeScript 新问题。我正在尝试从 Angular 的 $modalInstance 返回一个强类型的承诺。
我有类似的东西:
this.$modal.open(options).result.then(result => {
Currently result is type 'any'.
How do I cast it or affect it to be of type MyType? (see below)
});
interface myType {
a: string,
b: number
}
result: myType;
...
$modalInstance.close(this.result)
【问题讨论】:
标签: angularjs modal-dialog typescript angular-promise