I am receiving strange characters from the json file, so i guess the problem with the encoding so i need to add header to my http get request in the service i think something like this
headers.append('Content-type' , 'application/json;charset=UTF-8');
and here is my source service code:
import { Component, Input } from '@angular/core';
import { Injectable } from '@angular/core';
import { Http, Response, Headers, RequestOptions } from
'@angular/http';
import { HttpClient } from '@angular/common/http';
import {Observable} from 'rxjs/Rx';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
@Injectable()
export class listsService{
constructor(private http: HttpClient) { }
//get data from json file
getList(){
return this.http.get('../data.json')
.catch(err => {return "no data";});
}
}