File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
projects/schedule-x/angular/src/lib Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -86,16 +86,14 @@ export class CalendarComponent implements AfterViewInit {
8686
8787 ngAfterViewInit ( ) {
8888 if ( typeof window !== 'object' ) return ;
89- if ( typeof document !== 'undefined' ) {
90- // safe to use document here
91- const calendarElement = document ?. getElementById ( this . calendarElementId ) ;
92- if ( ! ( calendarElement instanceof HTMLElement ) ) {
93- throw new Error ( 'No calendar element found' ) ;
94- }
95-
96- this . setCustomComponentFns ( ) ;
97- this . calendarApp . render ( calendarElement ) ;
89+
90+ const calendarElement = document ?. getElementById ( this . calendarElementId ) ;
91+ if ( ! ( calendarElement instanceof HTMLElement ) ) {
92+ throw new Error ( 'No calendar element found' ) ;
9893 }
94+
95+ this . setCustomComponentFns ( ) ;
96+ this . calendarApp ?. render ( calendarElement ) ;
9997 }
10098
10199 private setCustomComponentFns ( ) {
You can’t perform that action at this time.
0 commit comments