【发布时间】:2018-06-04 18:20:57
【问题描述】:
我遇到了打字稿或 javascript 语法问题。 谁能告诉我 _ => this.log... 是什么意思?
我习惯于看到一个名称参数被传递到那里的箭头函数。
它只是意味着“无参数”吗?
参考:https://angular.io/tutorial/toh-pt6#add-heroserviceupdatehero
/** PUT: update the hero on the server */
updateHero (hero: Hero): Observable<any> {
return this.http.put(this.heroesUrl, hero, httpOptions).pipe(
tap(_ => this.log(`updated hero id=${hero.id}`)),
catchError(this.handleError<any>('updateHero'))
);
}
【问题讨论】:
标签: javascript angularjs typescript angular-services