本文整理匯總了TypeScript中angular2/core.NgZone.run方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript NgZone.run方法的具體用法?TypeScript NgZone.run怎麽用?TypeScript NgZone.run使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類angular2/core.NgZone
的用法示例。
在下文中一共展示了NgZone.run方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: setTimeout
this.openModal(null,{ready:()=> {
setTimeout(() => this.operationSelect.refresh(),0);
this.zone.run(()=> {
this.listOperations();
this.createChart(this.operations);
});
}});
示例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);
}
示例3:
touchid.authenticate((result) => {
this.ngZone.run(() => {
this.nav.push(GraphPage,{
attractionId: attractionId
});
});
}, (error) => {
示例4:
Tracker.autorun(() => zone.run(() => {
this.cartList = Carts.find({'ip':myip}).fetch();
if(Carts.find({'ip':myip}).count() == 1){
this.open('right');
}
}));
示例5:
this.autorunComputation = Tracker.autorun(() => {
this.zone.run(() => {
this.currentUser = Meteor.user();
this.currentUserId = Meteor.userId();
this.isLoggingIn = Meteor.loggingIn();
this.isLoggedIn = !!Meteor.user();
})
});
示例6: 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);
});
});
示例7:
worker.run({ elapsedTime: true }).subscribe((e) => {
this.zone.run(() => {
this.timeElapsed = e.elapsedTime + "";
this.ranCode = worker.workerBody;
this.output = e.data;
});
});
示例8: Photo
}).then(fileUrl => {
let photo = new Photo();
photo.filePath = fileUrl;
console.log("fileUrl: ", fileUrl);
this.ngZone.run( () => {
this.photos.push(photo);
});
}).catch(error => {
示例9:
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;
}
});