无限循环加载 workDays ejs-schedule
infinite loop on loading workDays ejs-schedule
我正在尝试通过一个函数加载工作日,我需要通过调用一个函数来加载工作日,以便我可以验证它工作的日期。
对于所有其他参数我可以执行等待逻辑处理和数据的方法调用return,只有[workDays]
参数在循环
如果我创建一个带有列表的 public 变量,它可以工作,但我需要执行方法调用以执行逻辑,然后 return 一个列表。
component.ts:
public getWorkDays() {
// Even returning the ready list it is in a loop updating the calendar.
let workDays = [1,2,3];
return workDays;
}
component.html:
<ejs-schedule #scheduleObj width='100%' [views]="scheduleViews" [timeScale]="getTimeScale()"
[workDays]="getWorkDays()" locale="pt" [showWeekend]="showWeekend" [startHour]="getStartHour(product)"
[endHour]="getEndHour(product)" height='450' [currentView]="'Week'" [selectedDate]="selectedDate"
[eventSettings]="eventSettings" [rowAutoHeight]="true">
</ejs-schedule>
使用下面的代码示例解决报告的问题。
https://stackblitz.com/edit/angular-wvhguq-r6jesc?file=app.component.ts
import { Component,ChangeDetectionStrategy } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: 'app.component.html',
providers: [WeekService, MonthService, ResizeService, DragAndDropService],
**changeDetection**: ChangeDetectionStrategy.OnPush
})
我正在尝试通过一个函数加载工作日,我需要通过调用一个函数来加载工作日,以便我可以验证它工作的日期。
对于所有其他参数我可以执行等待逻辑处理和数据的方法调用return,只有[workDays]
参数在循环
如果我创建一个带有列表的 public 变量,它可以工作,但我需要执行方法调用以执行逻辑,然后 return 一个列表。
component.ts:
public getWorkDays() {
// Even returning the ready list it is in a loop updating the calendar.
let workDays = [1,2,3];
return workDays;
}
component.html:
<ejs-schedule #scheduleObj width='100%' [views]="scheduleViews" [timeScale]="getTimeScale()"
[workDays]="getWorkDays()" locale="pt" [showWeekend]="showWeekend" [startHour]="getStartHour(product)"
[endHour]="getEndHour(product)" height='450' [currentView]="'Week'" [selectedDate]="selectedDate"
[eventSettings]="eventSettings" [rowAutoHeight]="true">
</ejs-schedule>
使用下面的代码示例解决报告的问题。
https://stackblitz.com/edit/angular-wvhguq-r6jesc?file=app.component.ts
import { Component,ChangeDetectionStrategy } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: 'app.component.html',
providers: [WeekService, MonthService, ResizeService, DragAndDropService],
**changeDetection**: ChangeDetectionStrategy.OnPush
})