Hotfix for preview on firefox

This commit is contained in:
GabrielMeyer 2019-08-28 11:53:23 +02:00
parent 899eedf403
commit c38142dc40

View File

@ -1,4 +1,4 @@
import { Component, Input } from '@angular/core'; import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import { SearchProperty } from 'app/core/ui-services/search.service'; import { SearchProperty } from 'app/core/ui-services/search.service';
@ -8,7 +8,8 @@ import { Searchable } from 'app/site/base/searchable';
@Component({ @Component({
selector: 'os-preview', selector: 'os-preview',
templateUrl: './preview.component.html', templateUrl: './preview.component.html',
styleUrls: ['./preview.component.scss'] styleUrls: ['./preview.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
}) })
export class PreviewComponent { export class PreviewComponent {
/** /**
@ -23,6 +24,7 @@ export class PreviewComponent {
const representation = model.formatForSearch(); const representation = model.formatForSearch();
this.formattedSearchValue = representation.properties; this.formattedSearchValue = representation.properties;
this.modelType = representation.type; this.modelType = representation.type;
this.cd.detectChanges();
} }
} }
@ -46,7 +48,7 @@ export class PreviewComponent {
* *
* @param sanitizer DomSanitizer * @param sanitizer DomSanitizer
*/ */
public constructor(private sanitizer: DomSanitizer) {} public constructor(private sanitizer: DomSanitizer, private cd: ChangeDetectorRef) {}
/** /**
* Function to sanitize any text to show html. * Function to sanitize any text to show html.