Angular 2, DomSanitizer, bypassSecurityTrustHtml, SVG

DEMO : https://plnkr.co/edit/Qke2jktna55h40ubUl8o?p=preview import { DomSanitizer } from ‘@angular/platform-browser’ @Pipe({ name: ‘safeHtml’}) export class SafeHtmlPipe implements PipeTransform { constructor(private sanitized: DomSanitizer) {} transform(value) { console.log(this.sanitized.bypassSecurityTrustHtml(value)) return this.sanitized.bypassSecurityTrustHtml(value); } } @Component({ selector: ‘my-app’, template: ` <div [innerHtml]=”html | safeHtml”> </div> `, }) export class App { name:string; html: safeHtml; constructor() { this.name=”Angular2″ this.html = “<svg> blah … Read more

Correct way Provide DomSanitizer to Component with Angular 2 RC6

You don’t need to declare providers: [ DomSanitizer ] anymore. Just need to import DomSanitizer as shown below, import { DomSanitizer, SafeResourceUrl, SafeUrl} from ‘@angular/platform-browser’; in component inject it through a constructor as below, constructor(private sanitizer: DomSanitizer) {}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)