docs(http): Remove extra semicolons in the http guide (#37228)
An extra semicolon in searchHeroes function was removed in the http guide found in aio/content/guide/http.md docs(http): Remove extra semicolon in a code example found in the http guide Removed extra semicolon in handleError function in the file located at aio/content/examples/http/src/app/config/config.service.ts, which serves as a source of code examples for the http guide. Replace a comma for a dot in the comment at line 79 to ensure consistency with the rest of the document. Capitalized and added a dot at the end of the comment at line 84 to ensure consistency with the other comments. PR Close #37228
This commit is contained in:
parent
d1aa4678be
commit
a259a84d3f
|
@ -76,15 +76,15 @@ export class ConfigService {
|
|||
console.error('An error occurred:', error.error.message);
|
||||
} else {
|
||||
// The backend returned an unsuccessful response code.
|
||||
// The response body may contain clues as to what went wrong,
|
||||
// The response body may contain clues as to what went wrong.
|
||||
console.error(
|
||||
`Backend returned code ${error.status}, ` +
|
||||
`body was: ${error.error}`);
|
||||
}
|
||||
// return an observable with a user-facing error message
|
||||
// Return an observable with a user-facing error message.
|
||||
return throwError(
|
||||
'Something bad happened; please try again later.');
|
||||
};
|
||||
}
|
||||
// #enddocregion handleError
|
||||
|
||||
makeIntentionalError() {
|
||||
|
|
|
@ -277,7 +277,7 @@ searchHeroes(term: string): Observable {
|
|||
return this.http.jsonp(heroesUrl, 'callback').pipe(
|
||||
catchError(this.handleError('searchHeroes', [])) // then handle the error
|
||||
);
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
This request passes the `heroesURL` as the first parameter and the callback function name as the second parameter.
|
||||
|
|
Loading…
Reference in New Issue