@@ -7,6 +7,8 @@ import { TranslateModule, TranslateService } from '@ngx-translate/core';
77import { ButtonModule } from '@oort-front/ui' ;
88import { SafeRestService } from '@oort-front/safe' ;
99import { debounceTime , takeUntil } from 'rxjs' ;
10+ import set from 'lodash/set' ;
11+ import get from 'lodash/get' ;
1012
1113/** Default css style example to initialize the form and editor */
1214const DEFAULT_STYLE = '' ;
@@ -74,7 +76,7 @@ export class CustomWidgetStyleComponent
7476 this . restService
7577 . post ( 'style/scss-to-css' , { scss } , { responseType : 'text' } )
7678 . subscribe ( ( css ) => {
77- this . widgetComp . widget . settings . widgetDisplay . style = value ;
79+ set ( this . widgetComp , ' widget.settings.widgetDisplay.style' , value ) ;
7880 this . styleApplied . innerText = css ;
7981 document
8082 . getElementsByTagName ( 'head' ) [ 0 ]
@@ -92,7 +94,7 @@ export class CustomWidgetStyleComponent
9294 if ( widgetStyle ) this . styleApplied = widgetStyle ;
9395 else this . styleApplied = document . createElement ( 'style' ) ;
9496
95- const style = this . widgetComp . widget . settings . widgetDisplay . style ;
97+ const style = get ( this . widgetComp , ' widget.settings.widgetDisplay.style' ) || '' ;
9698 if ( style ) {
9799 this . formControl . setValue ( style ) ;
98100 this . initialStyle = style ;
0 commit comments