Guest User

Untitled

a guest
Jun 20th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. import { Component, Input, Injector } from '@angular/core';
  2. import { DocumentUploadServiceProxy, OriginalBlobDto } from '@shared/service-proxies/service-proxies';
  3. import { AppComponentBase } from '@shared/common/app-component-base';
  4.  
  5. @Component({
  6. selector: 'gallery',
  7. templateUrl: './gallery.component.html',
  8. styleUrls: ['./gallery.component.css'],
  9. })
  10. export class GalleryComponent extends AppComponentBase {
  11.  
  12. @Input() dataCollection;
  13. selectedImage;
  14.  
  15. constructor(injector: Injector, private documentUploadService: DocumentUploadServiceProxy) {
  16. super(injector);
  17. }
  18.  
  19. setSelectedImage(image) {
  20. this.documentUploadService.getOriginalBlob('', image.blobFileName, '', image.docType).subscribe((result) => {
  21. this.selectedImage = result;
  22. });
  23. }
  24.  
  25. navigate(forward) {
  26. let index = this.dataCollection.indexOf(this.selectedImage) + (forward ? 1 : -1);
  27. if (index >= 0 && index < this.dataCollection.length) {
  28. this.selectedImage = this.dataCollection[index];
  29. }
  30. }
  31. }
Add Comment
Please, Sign In to add comment