-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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: refactor style guide example 03-06 #24996
Conversation
Failing the CI with the error:
|
77172d5
to
2047abe
Compare
@vicb should be fixed now |
map(response => response.json().data as Hero)); | ||
return this.http | ||
.get<Hero>(`api/heroes/${id}`) | ||
.pipe(map((response: any) => response.data as Hero)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
response
should already be a Hero
, afaict.
private http: Http | ||
) { } | ||
private http: HttpClient | ||
) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep the space (for consistency).
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the imports, the rest of this file should be identical to hero.service.ts.
return this.http.get(`api/heroes`).pipe( | ||
map(response => response.json() as Hero[])); | ||
return this.http.get<Hero[]>(`api/heroes`).pipe( | ||
map(response => response as Hero[])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pipe(map(...))
is no longer necessary (here and above).
2047abe
to
eef345a
Compare
@gkalpak Fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last nit. LGTM otherwise (assuming CI is green) 👍
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should stay 😇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I open the file there is a free line after the last curly bracket and in GitHub Web too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but this is the line before the last curly 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh damit 😅
docs: refactor style guide example 03-06 docs: refactor style guide example 03-06 docs: refactor style guide example 03-06
eef345a
to
c516eab
Compare
Thanks for the update, merging again. |
docs: refactor style guide example 03-06 docs: refactor style guide example 03-06 docs: refactor style guide example 03-06 PR Close #24996
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Style guide example 03-06 uses the old Angular Http module
What is the new behavior?
Updated the example to use thew new HttpClient
Does this PR introduce a breaking change?
Other information