I have an angular app. Now I have a link like https://example.com/Exam/denemedir.html . I want to bind this html to div element without using iframe, because I want to effect css code in page.css in angular app. With Iframe css codes doesn't work
This is my html code
<ion-content>
<div class="text-center head">
<a routerLink="/subjects"><i class="fa fa-lg fa-arrow-left"></i></a>
<h5>{{subject.name}}</h5>
<a class="home" routerLink="/home"><i class="fa fa-lg fa-home"></i></a>
</div>
<div class="content"[innerHTML]="content | safe : 'html'" ></div>
</ion-content>
this is my safe pipe
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer, SafeHtml, SafeStyle, SafeScript, SafeUrl, SafeResourceUrl } from '@angular/platform-browser';
@Pipe({
name: 'safe'
})
export class SafePipe implements PipeTransform {
constructor(protected sanitizer: DomSanitizer) {}
public transform(value: any, type: string): SafeHtml | SafeStyle | SafeScript | SafeUrl | SafeResourceUrl {
switch (type) {
case 'html': return this.sanitizer.bypassSecurityTrustHtml(value);
case 'style': return this.sanitizer.bypassSecurityTrustStyle(value);
case 'script': return this.sanitizer.bypassSecurityTrustScript(value);
case 'url': return this.sanitizer.bypassSecurityTrustUrl(value);
case 'resourceUrl': return this.sanitizer.bypassSecurityTrustResourceUrl(value);
default: throw new Error(`Invalid safe type specified: ${type}`);
}
}
}
but I don't know how to bind this url html to div element. Is there any way to bind html from url ?