mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Document Viewer Review
This commit is contained in:
@@ -3,6 +3,8 @@ import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { AlertController, ModalController } from '@ionic/angular';
|
||||
import { ViewerPage } from 'src/app/pages/events/attachments/viewer/viewer.page'
|
||||
|
||||
@Component({
|
||||
selector: 'app-attachments',
|
||||
@@ -14,7 +16,7 @@ export class AttachmentsPage implements OnInit {
|
||||
loadedEventAttachments: Attachment[];
|
||||
pageId: string;
|
||||
|
||||
constructor(private attachamentsService: AttachmentsService, private activatedRoute: ActivatedRoute, private iab: InAppBrowser, private route: Router) { }
|
||||
constructor(private attachamentsService: AttachmentsService, private activatedRoute: ActivatedRoute, private iab: InAppBrowser, private route: Router, private modalCtrl: ModalController) { }
|
||||
|
||||
ngOnInit() {
|
||||
/* Emit new data when something changes */
|
||||
@@ -32,14 +34,28 @@ export class AttachmentsPage implements OnInit {
|
||||
this.attachamentsService.getEventAttachments(eventid).subscribe(attachments => {
|
||||
this.loadedEventAttachments = attachments;
|
||||
this.pageId = eventid;
|
||||
console.log(this.pageId);
|
||||
});
|
||||
}
|
||||
|
||||
viewDocument(documenturl:string)
|
||||
async viewDocument(documenturl:string)
|
||||
{
|
||||
const browser = this.iab.create(documenturl);
|
||||
//var ref = cordova.InAppBrowser.open(documenturl, '_blank', 'location=yes');
|
||||
|
||||
const browser = this.iab.create(documenturl, "_self")
|
||||
browser.show();
|
||||
|
||||
// const modal = await this.modalCtrl.create({
|
||||
// component: ViewerPage,
|
||||
// componentProps: {
|
||||
// externalLink: documenturl
|
||||
// },
|
||||
// cssClass: 'viewer',
|
||||
// backdropDismiss: false
|
||||
// });
|
||||
|
||||
// await modal.present();
|
||||
|
||||
// modal.onDidDismiss();
|
||||
}
|
||||
|
||||
navigateBack(){
|
||||
|
||||
Reference in New Issue
Block a user