Content-Length: 305444 | pFad | http://github.com/angular/angular/pull/60738/files

5F docs(docs-infra): first-app tutorial - minor corrections by ryncdr · Pull Request #60738 · angular/angular · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(docs-infra): first-app tutorial - minor corrections #60738

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions adev/src/content/tutorials/first-app/steps/14-http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ The data source has been configured, the next step is to update your web app to
HELPFUL: For this example, the code uses `fetch`. For more advanced use cases consider using `HttpClient` provided by Angular.

1. Update the `getHousingLocationsById` function to make a call to the web server you configured.

HELPFUL: Notice the `fetch` method has been updated to _query_ the data for location with a matching `id` property value. See [URL Search Parameter](https://developer.mozilla.org/en-US/docs/Web/API/URL/search) for more information.

<docs-code header="" path="adev/src/content/tutorials/first-app/steps/14-http/src-final/app/housing.service.ts" visibleLines="[15,18]"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ export class HousingService {
}

async getHousingLocationById(id: number): Promise<HousingLocation | undefined> {
const data = await fetch(`${this.url}/${id}`);
return (await data.json()) ?? {};
const data = await fetch(`${this.url}?id=${id}`);
const locationJson = await data.json();
return (locationJson[0]) ?? {};
}

submitApplication(firstName: string, lastName: string, email: string) {
Expand Down
Loading








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/angular/angular/pull/60738/files

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy