Skip to content

Commit fb18240

Browse files
committed
test(schedule-x#112): fixed failing test
1 parent 07287ce commit fb18240

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

projects/schedule-x/angular/src/lib/calendar.component.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff 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() {

0 commit comments

Comments
 (0)