mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
Bug not fix
This commit is contained in:
@@ -8,6 +8,7 @@ import { ViewMediaPageRoutingModule } from './view-media-routing.module';
|
||||
|
||||
import { ViewMediaPage } from './view-media.page';
|
||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
import { PdfViewerModule } from 'ng2-pdf-viewer';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -16,6 +17,7 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
IonicModule,
|
||||
FontAwesomeModule,
|
||||
ViewMediaPageRoutingModule,
|
||||
PdfViewerModule
|
||||
],
|
||||
declarations: [ViewMediaPage]
|
||||
})
|
||||
|
||||
@@ -24,6 +24,11 @@
|
||||
<img src="{{image}}">
|
||||
</div>
|
||||
<div *ngIf="type == 'application/pdf'">
|
||||
<pdf-viewer [src]="image"
|
||||
[render-text]="true"
|
||||
[original-size]="false"
|
||||
style="width: 400px; height: 500px"
|
||||
></pdf-viewer>
|
||||
</div>
|
||||
</div>
|
||||
</ion-slide>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { DomSanitizer} from '@angular/platform-browser';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-media',
|
||||
@@ -18,9 +19,12 @@ export class ViewMediaPage implements OnInit {
|
||||
maxRation: 2
|
||||
};
|
||||
|
||||
base64Sanitize:any = "";
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private navParams:NavParams,
|
||||
public sanitizer: DomSanitizer,
|
||||
) {
|
||||
this.image = this.navParams.get('image')
|
||||
this.type = this.navParams.get('type')
|
||||
@@ -29,8 +33,18 @@ export class ViewMediaPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.image)
|
||||
this.base64Sanitize = this.sanitizer.bypassSecurityTrustResourceUrl(eval(this.image));
|
||||
console.log(this.base64Sanitize)
|
||||
|
||||
}
|
||||
|
||||
sanitizeBase64() {
|
||||
return this.sanitizer.bypassSecurityTrustResourceUrl(this.image);
|
||||
}
|
||||
|
||||
|
||||
|
||||
close(){
|
||||
this.modalController.dismiss()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user