• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript core.NgZone类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript core.QueryList类代码示例发布时间:2022-05-25
下一篇:
TypeScript core.KeyValueDiffers类代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap