我正在学习 Angular。我正在https://stackblitz.com/angular/akkkxgnylgd学习 angular.io/tutorial 英雄之旅。在app/hero.service.ts
,有这个代码:
@Injectable()
export class HeroService {
private heroesUrl = 'api/heroes'; // URL to web api
constructor(
private http: HttpClient,
private messageService: MessageService) { }
/** GET heroes from the server */
getHeroes (): Observable<Hero[]> {
return this.http.get<Hero[]>(this.heroesUrl)
.pipe(
tap(heroes => this.log(`fetched heroes`)),
catchError(this.handleError('getHeroes', []))
);
}
我试图调查对/api/heroes
. 我打开了 Chrome 开发者工具,但找不到任何对/api/heroes
. 如何查看此 URL 的调用?