Add page.publitas_link for read PDF.
Nginx configuration for CORS https://www.industriapaisaia.eus
This commit is contained in:
parent
b95f6046c5
commit
a535ed9a8e
@ -38,7 +38,7 @@
|
||||
<section class="section-publitas">
|
||||
<div class="row" *ngIf="page.publitas_link">
|
||||
<div class="col-md-12">
|
||||
<simple-pdf-viewer #pdfViewer [src]="'../assets/'+page.publitas_link" [removePageBorders]="true"></simple-pdf-viewer>
|
||||
<simple-pdf-viewer #pdfViewer [src]="page.publitas_link" [removePageBorders]="true"></simple-pdf-viewer>
|
||||
<div class="pdf-buttons" *ngIf="!pdfViewer.isDocumentLoaded()">
|
||||
<button>Cargando documento</button>
|
||||
</div>
|
||||
|
@ -3,7 +3,7 @@ import { BrowserModule } from '@angular/platform-browser';
|
||||
import { PageService } from '../page.service';
|
||||
import { PageItem } from '../page';
|
||||
import { ActivatedRoute,Router, NavigationEnd } from "@angular/router";
|
||||
import { SafeResourceUrl, DomSanitizer } from '@angular/platform-browser';
|
||||
import { SafeResourceUrl, DomSanitizer,SafeUrl } from '@angular/platform-browser';
|
||||
import {
|
||||
AccessibilityConfig,
|
||||
Action,
|
||||
@ -34,7 +34,7 @@ import * as $ from 'jquery';
|
||||
})
|
||||
export class PageComponent implements OnInit {
|
||||
|
||||
pages : PageItem[];
|
||||
pages : PageItem[] = [];
|
||||
slug : string;
|
||||
parent : string;
|
||||
imageIndex = 1;
|
||||
@ -69,10 +69,17 @@ export class PageComponent implements OnInit {
|
||||
}
|
||||
|
||||
getPage() {
|
||||
console.log(this.slug);
|
||||
// console.log(this.slug);
|
||||
this.pageService.getPage(this.slug)
|
||||
.subscribe(data => {
|
||||
this.pages = data;
|
||||
this.pages.forEach( (p) => {
|
||||
|
||||
var safeUrl:SafeUrl;
|
||||
safeUrl = this.sanitizer.bypassSecurityTrustUrl('https://backend.industriapaisaia.eus/wp-content/uploads/2018/10/test.pdf');
|
||||
p['publitas_link_sanitize'] = safeUrl;
|
||||
console.log(p['publitas_link_sanitize']);
|
||||
})
|
||||
//console.log(data);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user