错误 TS1238:当作为表达式调用时,无法解析 class 装饰器的签名。 Angular
error TS1238: Unable to resolve signature of class decorator when called as an expression. Angular
我的项目有问题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());
}
}
在我的 IDE 的控制台中我有这个错误 ERROR in src/contact.service/contacts.service.ts(4,1): error TS1238:当作为表达式调用时,无法解析 class 装饰器的签名。
我也有同样的错误
有没有人可以帮助我,谢谢:)
改变
@Injectable
至
@Injectable()
它适用于 angular 4、5 或 6 的版本
我按照此页面更新了我的版本,将会 运行
谢谢你我的朋友
我的项目有问题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());
}
}
在我的 IDE 的控制台中我有这个错误 ERROR in src/contact.service/contacts.service.ts(4,1): error TS1238:当作为表达式调用时,无法解析 class 装饰器的签名。
我也有同样的错误
有没有人可以帮助我,谢谢:)
改变
@Injectable
至
@Injectable()
它适用于 angular 4、5 或 6 的版本 我按照此页面更新了我的版本,将会 运行
谢谢你我的朋友