DayPilot Angular 8 Scheduler Error: The placeholder element not found when refresh
DayPilot Angular 8 Scheduler Error: The placeholder element not found when refresh
我正在使用 Angular 8 DayPilot Scheduler
当从 link 重定向时它能够很好地显示调度程序图表,但是如果直接进入 URL 或刷新当前调度程序页面,调度程序图表将消失并会出现错误:
SchedulerComponent.html:1 ERROR Error: DayPilot.Scheduler: The placeholder element not found: 'dp_157775431314089808'.
at viewWrappedDebugError (core.js:19411)
at callWithDebugContext (core.js:30049)
at Object.debugCheckAndUpdateView [as checkAndUpdateView] (core.js:29741)
at ViewRef_.push../node_modules/@angular/core/fesm5/core.js.ViewRef_.detectChanges (core.js:20458)
at ApplicationRef.push../node_modules/@angular/core/fesm5/core.js.ApplicationRef.tick (core.js:26837)
at core.js:26726
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:391)
at Object.onInvoke (core.js:25986)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:390)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:150)
我的 SchedulerComponent.html 第 1 行:
<daypilot-scheduler [config]="config" [events]="events" #scheduler></daypilot-scheduler>
我可以通过应用以下替代解决方案来修复它:刷新页面时强制重新渲染组件,尽管控制台错误仍然存在
但至少现在可以使用调度程序
html
<div *ngIf="_reload">
<daypilot-scheduler [config]="config" [events]="events" #scheduler></daypilot-scheduler>
</div>
ts
export class SchedulerComponent implements AfterViewInit{
_reload = true;
constructor() {}
private reload() {
setTimeout(() => (this._reload = false));
setTimeout(() => (this._reload = true));
}
public ngAfterViewInit(): void {
this.reload();
}
}
我正在使用 Angular 8 DayPilot Scheduler 当从 link 重定向时它能够很好地显示调度程序图表,但是如果直接进入 URL 或刷新当前调度程序页面,调度程序图表将消失并会出现错误:
SchedulerComponent.html:1 ERROR Error: DayPilot.Scheduler: The placeholder element not found: 'dp_157775431314089808'.
at viewWrappedDebugError (core.js:19411)
at callWithDebugContext (core.js:30049)
at Object.debugCheckAndUpdateView [as checkAndUpdateView] (core.js:29741)
at ViewRef_.push../node_modules/@angular/core/fesm5/core.js.ViewRef_.detectChanges (core.js:20458)
at ApplicationRef.push../node_modules/@angular/core/fesm5/core.js.ApplicationRef.tick (core.js:26837)
at core.js:26726
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:391)
at Object.onInvoke (core.js:25986)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:390)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:150)
我的 SchedulerComponent.html 第 1 行:
<daypilot-scheduler [config]="config" [events]="events" #scheduler></daypilot-scheduler>
我可以通过应用以下替代解决方案来修复它:刷新页面时强制重新渲染组件,尽管控制台错误仍然存在 但至少现在可以使用调度程序
html
<div *ngIf="_reload">
<daypilot-scheduler [config]="config" [events]="events" #scheduler></daypilot-scheduler>
</div>
ts
export class SchedulerComponent implements AfterViewInit{
_reload = true;
constructor() {}
private reload() {
setTimeout(() => (this._reload = false));
setTimeout(() => (this._reload = true));
}
public ngAfterViewInit(): void {
this.reload();
}
}