本文整理汇总了TypeScript中@angular/core.EventEmitter.next方法的典型用法代码示例。如果您正苦于以下问题:TypeScript EventEmitter.next方法的具体用法?TypeScript EventEmitter.next怎么用?TypeScript EventEmitter.next使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/core.EventEmitter
的用法示例。
在下文中一共展示了EventEmitter.next方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: visit
/**
* Method to emit context when it is visited.
*
* @param context
* Object that represents the current context. Community, Collection, or Item.
*/
visit(context): void {
if(context.root) {
this.setRoot(context)
}
this.contextProvider.context = context;
this.emitter.next({action: 'visit', context: context});
}
示例2: goSadder
// I emit a valueChange event to decrease the mood level.
public goSadder() : void {
if ( ! this.isSaddest() ) {
this.valueChange.next( this.value - 1 );
}
}
示例3: goHappier
// ---
// PUBLIC METHODS.
// ---
// I emit a valueChange event to increase the mood level.
public goHappier() : void {
if ( ! this.isHappiest() ) {
this.valueChange.next( this.value + 1 );
}
}
示例4: _calcTime
private _calcTime(time: Date) {
this.runningTime = time;
this.clockRunning = true;
document.title = `${this.runningTime.getMinutes()}:${this.runningTime.getSeconds()}`;
if (this.runningTime.getSeconds() === 0 && this.runningTime.getMinutes() === 0) {
this.timeCompleted.next(true);
this.phaseType = null;
this.clockRunning = false;
document.title = 'Focus Time Management';
}
}
示例5:
( event: MouseEvent ) : void => {
// Try to prevent text from being highlighted by the drag action.
event.preventDefault();
// Get the change in mouse location.
var deltaX = ( event.pageX - this.initialMouseLocation.x );
var deltaY = ( event.pageY - this.initialMouseLocation.y );
// Use the mouse delta to calculate the element's position delta.
this.positionChange.next({
left: ( this.initialElementPosition.left + deltaX ),
top: ( this.initialElementPosition.top + deltaY )
});
}
示例6: unparsedJson
set unparsedJson(value: string) {
if (this._unparsedJson !== value) {
this._unparsedJson = value;
let parsedJson : any = null;
try {
parsedJson = JSON.parse(this._unparsedJson);
}
catch (e) {
this.parsedJson = null;
//console.log(e);
}
if (parsedJson !== this.parsedJson) {
this.parsedJson = parsedJson;
this.parsedJsonChanged.next(this.parsedJson);
}
}
}
示例7: value
set value(newValue: T) {
let hasValueChanged: boolean = newValue !== this._value;
this._value = newValue;
this._onChangedValue.next(hasValueChanged);
}
示例8: changeMe
changeMe() {
this.num++;
this.fromParent = 'Changed from child. Count: ' + this.num;
this.fromParentChange.next(this.fromParent);
}
示例9:
( percent: number ) : void => {
this.scrollPercentageEvent.next( percent );
}