0
При попытке скомпилировать следующий машинопись класс я получаю ошибку:свойство не существует ошибка в машинописном классе
"use strict";
import { Http, Headers } from '@angular/http';
const remote: string = 'http://localhost:3000';
export class ApiEndpoint {
public contentHeader: Headers = new Headers({"Content-Type": "application/json"});
constructor(private _http: Http) {}
static signup(payload) {
let url = `${remote}/auth/signup`;
return this._http.post(url, JSON.stringify(payload), {headers: this.contentHeader});
}
static checkUsername(username) {
let url = `${remote}/auth/checkUsername/${username}`;
return this._http.get(url);
}
}
Ошибки:
17): Error TS2339: Property '_http' does not exist on type 'typeof ApiEndpoint'.
TypeScript error:(12,73): Error TS2339: Property 'contentHeader' does not exist on type 'typeof ApiEndpoint'.
TypeScript error: /(17,17): Error TS2339: Property '_http' does not exist on type 'typeof ApiEndpoint'.