我有一个使用角度的HTTP服务 @Injectable()
export class MyService {
constructor(private http: Http) { }
getThings() {
return this.http.get('url').map((res) => {
// massage data here and ret
试图创建一个可以推送给所有订阅者的可观察对象,但是我遇到了多个订阅的问题。这是我的理解,订户管理是为我自动处理的。在下面的例子中,我的目标是记录'a'和'b'。 let observer = null as any;
let ob$ = new Observable<any>(ob => {
//this piece of code will be called twice, over