本文整理汇总了TypeScript中angular2/core.EventEmitter类的典型用法代码示例。如果您正苦于以下问题:TypeScript EventEmitter类的具体用法?TypeScript EventEmitter怎么用?TypeScript EventEmitter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了EventEmitter类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: closeAlert
closeAlert() {
this.closeAlertEventEmitter.emit();
}
示例2: addTask
addTask(newDescription){
this.onSubmitNewTask.emit(newDescription.value);
newDescription.value="";
}
示例3: deleteEntry
deleteEntry(entry: Entry){
this.onSubmitDeleteEntry.emit(entry);
}
示例4: onPageSizeChanged
onPageSizeChanged(pageSize : number){
this.pageDetails.pageSize = +pageSize;
this.changed.emit(null);
}
示例5: pushStateToSubscribers
// This method can be called by subscribers to force a push. Useful when a
// component is initialized.
pushStateToSubscribers() {
let persistenceState = this.getState();
console.log('PersistenceService publishing state change:', persistenceState);
this.persistenceStateChanged.next(persistenceState);
}
示例6: addKeg
addKeg(userName: HTMLInputElement, userBrand: HTMLInputElement, userPrice: HTMLInputElement, userPintsLeft: HTMLInputElement) {
var newKeg: Keg = new Keg(userName.value, userBrand.value, userPrice.value, userPintsLeft.valueAsNumber, 0);
this.onSubmitNewKeg.emit(newKeg);
}
示例7: addTask
addTask(userDescription: HTMLInputElement, userPriority: HTMLInputElement){
var newTask = [userDescription.value, userPriority.value];
this.onSubmitNewTask.emit(newTask);
userDescription.value = "";
userPriority.value="low";
}
示例8: closeDetailsField
closeDetailsField() {
this.closeDetails.emit(1);
}
示例9: onSelect
onSelect(strain) {
this.emitter.emit(strain);
}
示例10: newTask
newTask(newDescription: HTMLInputElement): void {
this.onSubmitNewTask.emit(newDescription.value);
newDescription.value = "";
}