Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F64079827
field-interaction.service.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, May 24, 10:55
Size
823 B
Mime Type
text/x-java
Expires
Sun, May 26, 10:55 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
17852949
Attached To
rSVGTESTAPP svg-test-app
field-interaction.service.ts
View Options
import { Word } from '../models/models';
import {EventEmitter} from '@angular/core';
import {Subject} from 'rxjs';
export class WordService {
onHoveredWord = new EventEmitter<Word>();
offHoveredWord = new EventEmitter<Word>();
oldClickedWord: Word;
onClickedWord = new EventEmitter<Word>();
private informationSource = new Subject<Word>();
wordChange$ = this.informationSource.asObservable();
updateInfo(information: Word) {
this.informationSource.next(information);
}
public onClickService(word: Word) {
if ( word !== this.oldClickedWord) {
this.onClickedWord.emit(word);
this.oldClickedWord = word;
}
}
public mouseEnterService(word: Word) {
this.onHoveredWord.emit(word);
}
public mouseLeaveService(word: Word) {
this.offHoveredWord.emit(word);
}
}
Event Timeline
Log In to Comment