當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript MeteorObservable.subscribe方法代碼示例

本文整理匯總了TypeScript中meteor-rxjs.MeteorObservable.subscribe方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript MeteorObservable.subscribe方法的具體用法?TypeScript MeteorObservable.subscribe怎麽用?TypeScript MeteorObservable.subscribe使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在meteor-rxjs.MeteorObservable的用法示例。


在下文中一共展示了MeteorObservable.subscribe方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1:

            .subscribe(poemId => {
                this.poemId = poemId;

                // Subscribe to this poem
                if (this.poemSub) {
                    this.poemSub.unsubscribe();
                }

                this.poemSub = MeteorObservable.subscribe('poems', {}, {
                        poemId: this.poemId
                    })
                .subscribe(() => {
                    this.poem = Poems.findOne(this.poemId);
                });

                // Subscribe to the list of contributors for this poem
                if (this.contributorSub) {
                    this.contributorSub.unsubscribe();
                }

                this.contributorSub = MeteorObservable.subscribe('contributors', this.poemId)
                    .subscribe(() => {
                        this.contributors = Users.find({}).zone();
                    });
            });
開發者ID:babyshoes,項目名稱:exquisite-corpus,代碼行數:25,代碼來源:poem-details.component.ts

示例2: ngOnInit

 ngOnInit() {
   this.todos = Todos.find();
   // Subscribe and connect it to Angular's change detection system
   // while running on client
   if (Meteor.isClient)
     this.todoListSubscription = MeteorObservable.subscribe('todoList').subscribe();
 }
開發者ID:Urigo,項目名稱:angular-meteor,代碼行數:7,代碼來源:todo-list.component.ts

示例3: ngOnInit

 ngOnInit() {
   this.usersSub = MeteorObservable.subscribe('pipeUsers').subscribe(() => {
     MeteorObservable.autorun().subscribe(() => {
       this.users = this._userService.findUsers();
     });
   });
 }
開發者ID:michaelb-01,項目名稱:pipe,代碼行數:7,代碼來源:users.component.ts

示例4: ngOnInit

 ngOnInit() {
   MeteorObservable.subscribe('users').subscribe(() => {
     MeteorObservable.autorun().subscribe(() => {
       this.users = this.findUsers().zone();
     });
   });
 }
開發者ID:pro-to-tip,項目名稱:pro-to-tip.github.io,代碼行數:7,代碼來源:new-chat.ts

示例5: subscribeUsers

  subscribeUsers(): Subscription {
    // Fetch all users matching search pattern
    const subscription = MeteorObservable.subscribe('users', this.searchPattern.getValue());
    const autorun = MeteorObservable.autorun();

    return Observable.merge(subscription, autorun).subscribe(() => {
      this.users = this.findUsers();
    });
  }
開發者ID:ShinFDuran,項目名稱:Pruebas,代碼行數:9,代碼來源:new-chat.ts

示例6:

            .subscribe(userId => {
                this.userId = userId;

                // Subscribe to this user
                if (this.userSub) {
                    this.userSub.unsubscribe();
                }

                this.userSub = MeteorObservable.subscribe('user', this.userId).subscribe(() => {
                    this.user = Users.findOne(this.userId);
                });
            });
開發者ID:babyshoes,項目名稱:exquisite-corpus,代碼行數:12,代碼來源:user-profile.component.ts

示例7:

      .subscribe(trackId => {
        this.trackId = trackId;
        
        if (this.trackSub) {
          this.trackSub.unsubscribe();
        }

        this.trackSub = MeteorObservable.subscribe('track', this.trackId).subscribe(() => {
          MeteorObservable.autorun().subscribe(() => {
            this.track = Tracks.findOne(this.trackId);
            this.getUsers(this.track);
          });
        });

        if (this.uninvitedSub) {
          this.uninvitedSub.unsubscribe();
        }

        this.uninvitedSub = MeteorObservable.subscribe('uninvited', this.trackId).subscribe(() => {
          this.getUsers(this.track);
        });
      });
開發者ID:harishmaiya,項目名稱:gundmi48-gadikatte58,代碼行數:22,代碼來源:track-details.component.ts

示例8:

      .subscribe(params => {
        this.entityId = params['entityId'];
        this.taskType = params['taskType'];

        if (this.entitySub) {
          this.entitySub.unsubscribe();
        }

        this.entitySub = MeteorObservable.subscribe('entity', this.entityId).zone().subscribe(() => {
          MeteorObservable.autorun().subscribe(() => {
            this.entity = this._entityService.getEntityById(this.entityId);
          });
        });
      });
開發者ID:michaelb-01,項目名稱:pipe,代碼行數:14,代碼來源:entity.component.ts

示例9: ngOnInit

  ngOnInit(): void {
    this.profile = (({name = '', pictureId} = {}) => ({
      name,
      pictureId
    }))(Meteor.user().profile);

    MeteorObservable.subscribe('user').subscribe(() => {
      let platform = this.platform.is('android') ? "android" :
        this.platform.is('ios') ? "ios" : "";
      platform = this.platform.is('cordova') ? platform : "";

      this.picture = Pictures.getPictureUrl(this.profile.pictureId, platform);
    });
  }
開發者ID:DAB0mB,項目名稱:ionic2-meteor-messenger,代碼行數:14,代碼來源:profile.ts

示例10:

      .subscribe(versionId => {
        this.versionId = versionId;

        if (this.versionSub) {
          this.versionSub.unsubscribe();
        }

        this.versionSub = MeteorObservable.subscribe('versions', this.versionId).zone().subscribe(() => {
          MeteorObservable.autorun().subscribe(() => {
            this.version = this._versionService.getVersionById(versionId);

            this.nextVersion = this._versionService.getNextVersion(this.version.entity.entityId, this.version.version, this.version.taskType.type);
            this.prevVersion = this._versionService.getPrevVersion(this.version.entity.entityId, this.version.version, this.version.taskType.type);
          });
        });
      });
開發者ID:michaelb-01,項目名稱:pipe,代碼行數:16,代碼來源:review.component.ts


注:本文中的meteor-rxjs.MeteorObservable.subscribe方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。