BMW*_*W83 2 angular-services angular
我的项目角度有问题,但我不知道问题出在哪里。我想在我的项目中添加一项服务,因为我像这样定义了该服务
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());
}
}
Run Code Online (Sandbox Code Playgroud)
在我的 IDE 控制台中,我在 src/contact.service/contacts.service.ts(4,1) 中出现此错误:错误 TS1238:作为表达式调用时无法解析类装饰器的签名。
我也有同样的错误
有谁可以帮助我并谢谢你:)
改变
@Injectable
Run Code Online (Sandbox Code Playgroud)
到
@Injectable()
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2806 次 |
| 最近记录: |