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


TypeScript core.NgZone類代碼示例

本文整理匯總了TypeScript中angular2/core.NgZone的典型用法代碼示例。如果您正苦於以下問題:TypeScript NgZone類的具體用法?TypeScript NgZone怎麽用?TypeScript NgZone使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1:

                touchid.authenticate((result) => {
                    this.ngZone.run(() => {
	                    this.nav.push(GraphPage,{
	                    	attractionId: attractionId
	                    });
	                });
                }, (error) => {
開發者ID:CarlosLanderas,項目名稱:ionic-disney,代碼行數:7,代碼來源:attractions.ts

示例2: update

 /**
  * Update the state of the node based on selection
  * @param  {Boolean} isSelected
  */
 update(isSelected) {
   this.node.isSelected = isSelected;
   this.borderColor = this.node.isSelected ? '#0074D9' :
     'rgba(0, 0, 0, 0.125)';
   this.color = this.node.isSelected ? '#222' : '#888';
   this._ngZone.run(() => undefined);
 }
開發者ID:IgorMinar,項目名稱:batarangle,代碼行數:11,代碼來源:node-item.ts

示例3: setTimeout

 this.openModal(null,{ready:()=> {
     setTimeout(() => this.operationSelect.refresh(),0);
     this.zone.run(()=> {
         this.listOperations();
         this.createChart(this.operations);
     });
 }});
開發者ID:RGZINC,項目名稱:swagger2-angular2-materialize,代碼行數:7,代碼來源:chart-modal.ts

示例4:

 data.forEach((user) => {
   if(user.uid !== this.firebaseService.getMyUid()) {
     console.log("Adding:"+JSON.stringify(user));
     this.nameList.push(user);
     this.zone.run(() => this.nameClassifier.addToUserList(user));
     isSortingNeeded = true;
   }
 });
開發者ID:isvicbhasme,項目名稱:greeter,代碼行數:8,代碼來源:admin.ts

示例5:

			Tracker.autorun(() => zone.run(() => {
				this.cartList = Carts.find({'ip':myip}).fetch();


				if(Carts.find({'ip':myip}).count() == 1){
          this.open('right');
        }
			}));
開發者ID:ferrufino,項目名稱:VesperCart,代碼行數:8,代碼來源:cart-component.ts

示例6:

 this.autorunComputation = Tracker.autorun(() => {
   this.zone.run(() => {
     this.currentUser = Meteor.user();
     this.currentUserId = Meteor.userId();
     this.isLoggingIn = Meteor.loggingIn();
     this.isLoggedIn = !!Meteor.user();
   })
 });
開發者ID:Hongbo-Miao,項目名稱:angular2-meteor-accounts-ui,代碼行數:8,代碼來源:login-buttons.ts

示例7: ResponseOptions

          res.on('end', () => {
            let responseOptions = new ResponseOptions({body, status, headers, url});
            let response = new Response(responseOptions);

            if (utils.isSuccess(status)) {
              ngZome.run(() => {
                responseObserver.next(response);
              });
              ngZome.run(() => {
                responseObserver.complete();
              });
              return;
            }
            ngZome.run(() => {
              responseObserver.error(response);
            });
          });
開發者ID:TheLarkInn,項目名稱:universal,代碼行數:17,代碼來源:node_http.ts

示例8:

        worker.run({ elapsedTime: true }).subscribe((e) => {

            this.zone.run(() => {
                this.timeElapsed = e.elapsedTime + "";
                this.ranCode = worker.workerBody;
                this.output = e.data;
            });
        });
開發者ID:dragoncodes,項目名稱:DragonWorker,代碼行數:8,代碼來源:home.ts

示例9: Photo

 }).then(fileUrl => {
     let photo = new Photo();
     photo.filePath = fileUrl;
     console.log("fileUrl: ", fileUrl);
     this.ngZone.run( () => {
         this.photos.push(photo);    
     });
 }).catch(error => {
開發者ID:Anhmike,項目名稱:ionic2-weight-tracker,代碼行數:8,代碼來源:WeighInForm.ts

示例10: Observable

    this.response = new Observable(responseObserver => {
      let nodeReq;
      ngZome.run(() => {
        // http or https
        let xhrHttp: any = http;
        if (reqInfo.protocol === 'https:') {
          xhrHttp = https;
        }

        nodeReq = xhrHttp.request(reqInfo, (res: http.IncomingMessage) => {
          let body = '';
          res.on('data', (chunk) => body += chunk);

          let status = res.statusCode;
          let headers = new Headers(res.headers);
          let url = res.url;

          res.on('end', () => {
            let responseOptions = new ResponseOptions({body, status, headers, url});
            let response = new Response(responseOptions);

            if (utils.isSuccess(status)) {
              ngZome.run(() => {
                responseObserver.next(response);
              });
              ngZome.run(() => {
                responseObserver.complete();
              });
              return;
            }
            ngZome.run(() => {
              responseObserver.error(response);
            });
          });
        });
      });

      let onError = (err) => {
        let responseOptions = new ResponseOptions({body: err, type: ResponseType.Error});
        if (isPresent(baseResponseOptions)) {
          responseOptions = baseResponseOptions.merge(responseOptions);
        }
        ngZome.run(() => {
          responseObserver.error(new Response(responseOptions));
        });
      };

      nodeReq.on('error', onError);

      nodeReq.write(req.text());
      nodeReq.end();

      return () => {
        nodeReq.removeListener('error', onError);
        nodeReq.abort();
      };
    });
開發者ID:TheLarkInn,項目名稱:universal,代碼行數:57,代碼來源:node_http.ts


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