【发布时间】:2018-09-18 16:45:27
【问题描述】:
我的项目有问题,但我不知道问题出在哪里。我想在我的项目中添加一个服务,我这样定义这个服务
import {Injectable} from "@angular/core";
import {Http} from "@angular/http";
@Injectable
export class ContactService{
constructor(public http: Http){
}
getContacts(){
return this.http.get("http://localhost:8080/findPersons?
mc=wa&page=1&size=6").map(resp => resp.json());
}
}
在我的 IDE 的控制台中我有这个错误 错误在 src/contact.service/contacts.service.ts(4,1): 错误 TS1238: Unable to resolve signature of class decorator when called as an expression .
我也犯了同样的错误
有没有人可以帮助我,谢谢:)
【问题讨论】: