您可以使用此代码
@Injectable()export class AppServices{ constructor(private http: Http) { var obj; this.getJSON().subscribe(data => obj=data, error => console.log(error)); } public getJSON(): Observable<any> { return this.http.get("./file.json") .map((res:any) => res.json()) .catch((error:any) => console.log(error)); }}这
file.json是您的本地json文件。
另请参阅angular-cli的changlog路径
- https://github.com/angular/angular-cli/blob/master/CHANGELOG.md#100-rc4-2017-03-20



