【发布时间】:2016-06-09 02:21:18
【问题描述】:
当我在方法中使用参数装饰器时出现此构建错误。该类实现了一个接口。下面是接口和类:
export interface IClient{
getServerConfig(): Observable<Response> ;
getDashboard(): Observable<Response>;
deploy(channelId: string): Observable<Response>;
}
export class Client implements IClient {
public constructor( @Inject(Http) private http: Http, @Inject(Model) private config: Model) {
super(http, config);
}
public getServerConfig(): Observable<Response> {
return null;
}
public getDashboard(): Observable<Response> {
return null;
}
public deploy(@Body('param') channelId: string): Observable<Response> {
return null;
}
}
构建时出现此错误
Supplied parameters do not match any signature of call target.
就在部署函数处。
问题似乎是channelId参数旁边的参数装饰器。现在我不能在需要时删除它,所以我想知道是否有办法保留接口定义和装饰器。接口中不允许使用装饰器,因此这不是一个选项。
有什么想法吗?
【问题讨论】:
标签: typescript angular