Я использую menumodule primeng
Модель внутри меню имеет тип сигнал
и она взята из service
Теперь, когда вызывает сервис, и модель заполняется, эта ошибка отображается
, когда вызывает сервис, и модель заполняется.ERROR TypeError: Cannot read properties of null (reading 'offsetHeight')
// html code
Status Click
// код TypeScript
@ViewChild('menu') menu !: Menu;
listStatusTypes = signal([])
statusDispacherClick(data, event) {
this.service.getDashboardChangeStatusTypes(data).subscribe(dataService => {
dataService.map(x => {
x.label = x.title;
})
this.listStatusTypes.set(dataService);
this.cdRef.detectChanges();
this.menu.toggle(event);
})
}
Подробнее здесь: https://stackoverflow.com/questions/795 ... ht-in-prim