Newer
Older
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {DomSanitizer} from "@angular/platform-browser";
import {AppGlobal} from "../../../service/http.service";
@IonicPage()
@Component({
selector: 'page-preview',
templateUrl: 'preview.html',
})
export class PreviewPage {
stuffObj;
url = AppGlobal.domain + '/wisdomgroup';
attachments; //附件
constructor(public navCtrl: NavController, public navParams: NavParams,
public sanitizer:DomSanitizer) {
}
ionViewDidLoad() {
this.stuffObj = this.navParams.get('stuff');
if(this.stuffObj.attachments) this.attachments = this.stuffObj.attachments;
let con = this.stuffObj.content.replace(/\r?\n/g, "<br />");
this.stuffObj.content = this.sanitizer.bypassSecurityTrustHtml(con);
}
}