r/angular • • 24d ago

Angular API implementation

I’m a student that is working with angular for the first time, I have an assignment that requires implementing an api to our project. My teacher has no information on how to unwrap the response using parse for httpResource. There also is no information about mapping with httpclient & observables.

The documentation that is recommended seems completely irrelevant to my the api I have because my api is returning as an array.

How can I get value from the documentation or where should I look to figure this out. I feel like I’ve been having this problem with everything because the documentation never seems relevant. Even with certain concepts, there is things that I know but I am struggling with knowing what or how I can write things to do the task I need completed.

Any assistance would be appreciated.

3 Upvotes

19 comments sorted by

View all comments

0

u/[deleted] 24d ago

[deleted] — view deleted comment

2

u/dx_ninja_dx 24d ago

Well I am seeing in my log that I am fetching my data, when I click into the hyperlink the data I’m looking for is there. It’s just that my information is wrapped for example x = [{},{},{}]

Obviously with actual information that’s just a skeleton or template, but I’m supposed to unwrap it I believe back into json to display using parse. It just seems like there isn’t much information on parse in the documentation and my slides don’t have it either. So I’m just wondering how I’m supposed to figure this out cause I want to learn how to find these things myself, because my college really doesn’t teach us how to find stuff like this or how to use documentation. It seems like we’re just expected to know and understand documentation.

0

u/[deleted] 24d ago

[deleted] — view deleted comment

2

u/dx_ninja_dx 24d ago edited 24d ago

Okay I understand that is fair, there is no mention of validating I believe. I can’t remember if validating responses was mentioned in my lectures.

You are right, realistically thinking, it is valid JSON for should be. I’m not getting marks for this assignment anyways it’s past due, I just need to understand how to do it. I’ve been told by my teacher that the api, themealdb, doesn’t return JSON and that I’d need to parse it.

Also I appreciate the information, that makes a lot more sense, so basically if I am struggling with understanding that’s a core concept programming in general than angular’s documentation won’t be of any value.

I guess I’m gonna go review previous core concepts of programming and hope for the best

1

u/drunky1337 24d ago

Check out this resource https://roadmap.sh/frontend?r=frontend-beginner

That gives you a learning path including basics