-4
Ich kann JSON lokale Datei Angular HTTP-Dienst nicht erhalten. Ich habe diese Codes:Kann keine Daten von JSON-Datei
import {Injectable} from '@angular/core';
import {Http, Response} from "@angular/http";
import 'rxjs/add/operator/map'
@Injectable()
export class ApiService {
constructor(private http:Http) {
}
private coinsUrl:string = 'app/data/coins.json';
getMines() {
return this.http.get(this.coinsUrl).subscribe(
(res:Response)=> {
const sss = res.json();
console.log('sss', sss);
}
);
}
}
Ja, es funktioniert! Ich danke dir sehr :) –