I have used async pipe in angular 2 RC1, which lead to multiple request to server. In Angular2 beta 16 i have used share method to solve this.
import {Http, Headers, RequestOptions, URLSearchParams} from '@angular/http';
In constructor am requesting this._http.get(path, options)
In beta version i was using this._http.get(path, options).share()
import 'rxjs/add/operator/share';
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.