Angular2-调用多个web api restful服务

Angular2-调用多个web api restful服务,angular,asp.net-web-api,Angular,Asp.net Web Api,可以在我的Angular2应用程序中调用多个服务吗 我正在使用Http.Get进行调用,这会抛出随机错误,说明以下内容: Message":"An error has occurred.","ExceptionMessage":"An error occurred when trying to create a controller of type 'CustomersController'. Make sure that the controller has a parameterless p

可以在我的Angular2应用程序中调用多个服务吗

我正在使用Http.Get进行调用,这会抛出随机错误,说明以下内容:

Message":"An error has occurred.","ExceptionMessage":"An error occurred when trying to create a controller of type 'CustomersController'. Make sure that the controller has a parameterless public constructor.","ExceptionType":"System.InvalidOperationException"
我可以使用工具调用服务,但由于某些原因,多次调用不同的服务会导致此问题

代码:

publicGetCustomer(customerId:number):可观察{
//const body=JSON.stringify(customerId);
常量头=新头();
headers.append('Authorization','eyJ');
让params:URLSearchParams=新的URLSearchParams();
params.set('customerId',customerId.toString());
返回this.http.get(this.serviceUrl,{headers:headers,search:params})
.map((数据:响应)=>data.json())
.debounceTime(1000)
.distinctUntilChanged()
.接住(这个.把手错误);
}
私有getLookUp(查找:字符串){
const body=JSON.stringify(查找);
常量头=新头();
headers.append('Authorization','ssds');
返回this.http.get(this.serviceUrlBase+lookup,{headers:headers})
.地图
(
(data:Response)=>data.json()
)
.debounceTime(1000)
.distinctUntilChanged()
.接住(这个.把手错误);
}

您读到错误了吗

它表示向
CustomersController
添加一个无参数构造函数,如下所示:

constructor() {} 

你读到错误了吗

它表示向
CustomersController
添加一个无参数构造函数,如下所示:

constructor() {} 

是的,你可以调用很多服务,但是你最好粘贴代码添加你如何消费的代码services@stackdave代码添加now@MadhuRanjan现在添加的代码问题似乎与AngularJS无关,而是与服务器端有关。如果没有代码,我不确定会发生什么,但我想可能与您如何在IoC容器中注册依赖项有关。是的,您可以调用许多服务,但是你最好粘贴代码添加你如何消费的代码services@stackdave代码添加now@MadhuRanjan现在添加的代码问题似乎与AngularJS无关,而是与服务器端有关。如果没有代码,我不确定会发生什么,但我想可能与您如何向IoC容器注册依赖项有关。Typescript语法?Typescript语法?