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


TypeScript Observer.next方法代碼示例

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


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

示例1: Notification

        return this._http.post(this._apiBaseUrl, _n, { headers: headers }).map(response => response.json()).subscribe(data => {
            this._dataStore.tracks.push(data[0]);
            this._tracksObserver.next(this._dataStore.tracks);
            this._newestTrackObserver.next(data[0]);

            let trName = data[0].trackname;
            this._notes.add(new Notification('info', trName + ' bætt við.'));
        }, error => { this._notes.add(new Notification('error', 'Ekki tókst að tengjast gagnagrunni. Lagi ekki bætt við.')); });
開發者ID:kiddieverts,項目名稱:hl,代碼行數:8,代碼來源:track.service.ts

示例2: Notification

        this._http.get(_url).map(response => response.json()).subscribe(data => {

            // Set selectedProject
            this._dataStore.selectedProject = data[0];
            this._selectedProjectObserver.next(this._dataStore.selectedProject);

        }, error => { this._notes.add(new Notification('error', 'Ekki tóst að sækja verkefni í gagnagrunninn.')); });
開發者ID:kiddieverts,項目名稱:hl,代碼行數:7,代碼來源:project.service.ts

示例3: Notification

        this._http.delete(_url).subscribe(response => {
            // DELETE CREDITS FROM DATA STORE AND PUSH IT TO THE STREAM

            this._dataStore.credits = this._dataStore.credits.filter(credit => credit.projecttrackid !== track.id);
            this._creditsObserver.next(this._dataStore.credits);

        }, error => { this._notes.add(new Notification('error', 'Ekki tókst að ná eyða flytjanda.')); });
開發者ID:kiddieverts,項目名稱:hl,代碼行數:7,代碼來源:credit.service.ts

示例4:

                        Observable.forkJoin(fetchPages).subscribe(datas => {
                            let dataArray: any = datas;
                            dataArray.forEach((data: any) => {
                                comments = comments.concat(data.values);
                            },
                                (err: any) => {
                                    observer.error(err);
                                });

                            let modelComments: Comment[] = comments.map((jsonComment: any) => {
                                console.log(jsonComment);
                                let content: CommentContent = {
                                    html: jsonComment.content.html,
                                    markup: jsonComment.content.markup,
                                    raw: jsonComment.content.raw
                                };
                                let author: User = {
                                    userName: jsonComment.user.username,
                                    displayName: jsonComment.user.display_name,
                                    uuid: jsonComment.user.uuid
                                };
                                let comment: Comment = {
                                    content: content,
                                    author: author
                                };
                                return comment;
                            });

                            // Return the result to the observers
                            observer.next(modelComments);
                        },
開發者ID:vnctaing,項目名稱:stethoscope,代碼行數:31,代碼來源:bitbucket.service.ts

示例5: Question

 this._communicationService.roomChannel.on("new_question", msg => {
     let newQuestion = new Question();
     newQuestion.id = msg.question_id;
     newQuestion.order = msg.order;
     newQuestion.text = msg.question;
     
     let answers = new Array<Answer>();
     
     let answerA = new Answer();
     answerA.selector = "A";
     answerA.text = msg.a;                        
     answers.push(answerA);
     
     let answerB = new Answer();
     answerB.selector = "B";
     answerB.text = msg.b;                        
     answers.push(answerB);
     
     let answerC = new Answer();
     answerC.selector = "C";
     answerC.text = msg.c;                        
     answers.push(answerC);
     
     let answerD = new Answer();
     answerD.selector = "D";
     answerD.text = msg.d;                        
     answers.push(answerD);
     
     newQuestion.answers = answers;
     this._question = newQuestion;
     
     // Push the question down to the observable.
     this._questionObserver.next(this._question);
 });
開發者ID:Rumel,項目名稱:bluesky,代碼行數:34,代碼來源:trivia.service.ts

示例6: joinRoom

 joinRoom(room: any) {
     // Switch from the lobby to a specific room.
     this._communicationService.changeRoomChannel(room, this._playerService.getPlayerName());
     this._selectedRoom = room;
     
     // Tell the subscribers the room has changed.
     this._roomObserver.next(this._selectedRoom);  
 } 
開發者ID:Rumel,項目名稱:bluesky,代碼行數:8,代碼來源:room.service.ts

示例7: Date

				data => {
					console.log("refreshGoods, got data, now = " + new Date().toTimeString());
					this._dataStore.goods = data;
					if (this._goodsObserver) {
						console.log("refreshGoods, inform to observers, now = " + new Date().toTimeString());
						this._goodsObserver.next(this._dataStore.goods);
					}
				},
開發者ID:Dis1092006,項目名稱:B2B_Portal,代碼行數:8,代碼來源:goods.service.ts

示例8:

 position => {
   const coordinate: Coordinate = {
     latitude: position.coords.latitude,
     longitude: position.coords.longitude
   };
   observer.next(coordinate);
   observer.complete();
 },
開發者ID:cristianrgreco,項目名稱:nearby-pokemon,代碼行數:8,代碼來源:location.service.ts


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