Browse Source

No function in template.

pull/327/head
Sebastian Stehle 8 years ago
parent
commit
c16e929c7d
  1. 2
      src/Squidex/app/framework/angular/forms/iframe-editor.component.html
  2. 12
      src/Squidex/app/framework/angular/forms/iframe-editor.component.ts

2
src/Squidex/app/framework/angular/forms/iframe-editor.component.html

@ -1 +1 @@
<iframe #iframe scrolling="no" [attr.src]="sanitizedUrl()" width="100%"></iframe>
<iframe #iframe scrolling="no" [attr.src]="sanitizedUrl" width="100%"></iframe>

12
src/Squidex/app/framework/angular/forms/iframe-editor.component.ts

@ -7,7 +7,7 @@
import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, forwardRef, Input, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import { DomSanitizer } from '@angular/platform-browser';
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
import { Types } from '@app/framework/internal';
@ -35,7 +35,11 @@ export class IFrameEditorComponent implements ControlValueAccessor, AfterViewIni
public iframe: ElementRef;
@Input()
public url: string;
public set url(value: string) {
this.sanitizedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(value);
}
public sanitizedUrl: SafeResourceUrl;
constructor(
private readonly sanitizer: DomSanitizer,
@ -83,10 +87,6 @@ export class IFrameEditorComponent implements ControlValueAccessor, AfterViewIni
});
}
public sanitizedUrl() {
return this.sanitizer.bypassSecurityTrustResourceUrl(this.url);
}
public writeValue(obj: any) {
this.value = obj;

Loading…
Cancel
Save