json - response with status 200: ok -


i trying figure out how plot data local '.json' file using angular2-highcharts example.

i followed example in 'https://www.npmjs.com/package/angular2-highcharts' first understand how plot .json data , worked. took data available example , created local .json file (copied content 'https://www.highcharts.com/samples/data/jsonp.php?filename=aapl-c.json&callback=jsonp_callback' in notepad , saved utf-8 encoding .json file), , replaced file path json request this. when though, error - response status 200.

  constructor(jsonp : jsonp) {     //jsonp.get('https://www.highcharts.com/samples/data/jsonp.php?filename=aapl-c.json&callback=jsonp_callback').subscribe(res => {         jsonp.get('./data.json').subscribe(res => {         this.options = {             title : { text : 'aapl stock price' },            series : [{                name : 'aapl',                data : res.json(),               tooltip: {                    valuedecimals: 2               }          }]         };     }); } options: object; }; 

since not super familiar json data/ javascript or angular2 not sure if missing basic here. appreciated.

as far know, response status 200 specifies request successful. i.e. request handled. perhaps want try checking response data.

check callback response data.


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -