From c16e929c7d57d560168e7b31dd69d4c0348e9172 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Tue, 9 Oct 2018 21:55:24 +0200 Subject: [PATCH] No function in template. --- .../angular/forms/iframe-editor.component.html | 2 +- .../angular/forms/iframe-editor.component.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Squidex/app/framework/angular/forms/iframe-editor.component.html b/src/Squidex/app/framework/angular/forms/iframe-editor.component.html index 44f811b58..41a07a468 100644 --- a/src/Squidex/app/framework/angular/forms/iframe-editor.component.html +++ b/src/Squidex/app/framework/angular/forms/iframe-editor.component.html @@ -1 +1 @@ - + diff --git a/src/Squidex/app/framework/angular/forms/iframe-editor.component.ts b/src/Squidex/app/framework/angular/forms/iframe-editor.component.ts index bdbd181f3..374da7303 100644 --- a/src/Squidex/app/framework/angular/forms/iframe-editor.component.ts +++ b/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;