Closed syeddk closed 7 years ago
Even I tried with Observables, guys need help here
I am the sole maintainer of this repository and I also have a dayjob to attend. A little patience.
@Foxandxss , Thank you
@syeddk you can put your json file under public folder. And you can call it /filename.json
Other option: you can create a get call under webpack dev server. Via app.use then you can filter either req.method
Hi @hijoncon, Thank you for the reply. I will be a little more clear with my issue, please have a look at the scenario.
Here is my code
rs.service.ts (Service)
---------
getRulesets (): any {
this.http.get('/rulesets.json').map((res:Response) => res.json());
}
rs.component.ts (Component)
------------------
this.rulsetService.getRulesets().subscribe(content => this.staticJsonData = content);
And getting an issue mentioned below
What am I doing wrong?
You need to make sure that rulesets.json
is in a folder which is in/with other statically served assets.
Thanks @ollwenjones ,
Now i am getting 'undefined'. Even i am getting for REST API calls as well can any one help me out.
@syeddk do you still need help with HTTP services with Angular? If so, post your latest code here and I can try to help you debug it and make it work. Otherwise, I am going to close by the end of the day
Hi Team,
I am trying to make a call to static json using http module, having trouble loading data from JSON using http. Also tried with API call still no luck. Any help is appreciated.