mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
49 lines
1.3 KiB
TypeScript
49 lines
1.3 KiB
TypeScript
import { Component, OnInit } from '@angular/core';
|
|
import { AttachmentsService } from 'src/app/services/attachments.service';
|
|
import { Attachment } from 'src/app/models/attachment.model';
|
|
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
|
import { ModalController, NavParams } from '@ionic/angular';
|
|
|
|
@Component({
|
|
selector: 'app-attachments',
|
|
templateUrl: './attachments.page.html',
|
|
styleUrls: ['./attachments.page.scss'],
|
|
})
|
|
export class AttachmentsPage implements OnInit {
|
|
|
|
loadedEventAttachments: Attachment[];
|
|
pageId: string;
|
|
|
|
constructor(
|
|
private attachamentsService: AttachmentsService,
|
|
private iab: InAppBrowser,
|
|
private modalCtrl: ModalController,
|
|
private navParams: NavParams) { }
|
|
|
|
ngOnInit() {
|
|
this.loadAttachments(this.navParams.get('eventId'));
|
|
}
|
|
|
|
loadAttachments(eventid:string)
|
|
{
|
|
this.attachamentsService.getAttachmentsById(eventid).subscribe(attachments => {
|
|
this.loadedEventAttachments = attachments;
|
|
this.pageId = eventid;
|
|
},((erro) => {
|
|
console.error('loadtAttchament', erro)
|
|
}));
|
|
}
|
|
|
|
async viewDocument(documenturl:string)
|
|
{
|
|
const url: string = documenturl.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
|
const browser = this.iab.create(url,"_blank");
|
|
browser.show();
|
|
}
|
|
close(){
|
|
this.modalCtrl.dismiss(null);
|
|
}
|
|
|
|
|
|
}
|