Skip to content

Commit

Permalink
Adding outside triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
luisjjavier committed Mar 27, 2018
1 parent d4a252d commit 4615523
Show file tree
Hide file tree
Showing 7 changed files with 327 additions and 91 deletions.
55 changes: 55 additions & 0 deletions src/app/imageviewer/image-button-events-trigger.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import {Injectable} from '@angular/core';
import {Subject} from 'rxjs/Subject';

@Injectable()
export class ImageButtonEventsTriggerService {

private zoomInEmitter = new Subject;
private zoomOutEmitter = new Subject;
private rotateLeft = new Subject;
private rotateRight = new Subject;
private resetImage = new Subject;

constructor() {
}

emitZoomIn() {
this.zoomInEmitter.next();
}

zoomInListener() {
return this.zoomInEmitter;
}

emitZoomOut() {
this.zoomOutEmitter.next();
}

zoomOutListener() {
return this.zoomOutEmitter;
}

rotateLeftListener() {
return this.rotateLeft;
}

emitRotateLeft() {
this.rotateLeft.next();
}

rotateRightListener() {
return this.rotateRight;
}

emitRotateRight() {
this.rotateRight.next();
}

resetImageListener() {
return this.resetImage;
}

emitResetImage() {
this.resetImage.next();
}
}
3 changes: 1 addition & 2 deletions src/app/imageviewer/image.loader.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ResourceLoader, Dimension, toSquareAngle } from './imageviewer.model';
import { ImageViewerConfig } from './imageviewer.config';
import {ResourceLoader} from './imageviewer.model';

export class ImageResourceLoader extends ResourceLoader {

Expand Down
Loading

0 comments on commit 4615523

Please sign in to comment.