angular-changedetection

Angular markForCheck vs detectChanges

落花浮王杯 提交于 2021-02-18 12:13:27
问题 I'll start this question from notion that I've seen a similar question on StackOverflow , but that question had only answer for the difference . What I'm asking is what should I use depending on situation and what drawbacks one or another method may have . I know that detectChanges runs immediate change detection cycle on an element and its children, meanwhile markForCheck only marks current element and its ancestors as dirty and that they should be checked on the next change detection cycle.

Ag-grid defaultColDef not re-applied after initial component load

别等时光非礼了梦想. 提交于 2021-02-09 07:40:58
问题 Ag-grid applies defaultColDef formatting (cellStyle and cellRenderer) perfectly using ngOnChanges when the table initially receives async-retrieved data. However, if the component containing the grid is hidden and then re-initialized via an *ngIf condition, the table is re-populated with the correct data, but defaultColDef formatting is not reapplied even though the ngOnChanges is triggered again just as before, and this.gridOptions.defaultColDef = this.defaultColDef; is set within the

Ag-grid defaultColDef not re-applied after initial component load

百般思念 提交于 2021-02-09 07:39:50
问题 Ag-grid applies defaultColDef formatting (cellStyle and cellRenderer) perfectly using ngOnChanges when the table initially receives async-retrieved data. However, if the component containing the grid is hidden and then re-initialized via an *ngIf condition, the table is re-populated with the correct data, but defaultColDef formatting is not reapplied even though the ngOnChanges is triggered again just as before, and this.gridOptions.defaultColDef = this.defaultColDef; is set within the

Ag-grid defaultColDef not re-applied after initial component load

坚强是说给别人听的谎言 提交于 2021-02-09 07:37:53
问题 Ag-grid applies defaultColDef formatting (cellStyle and cellRenderer) perfectly using ngOnChanges when the table initially receives async-retrieved data. However, if the component containing the grid is hidden and then re-initialized via an *ngIf condition, the table is re-populated with the correct data, but defaultColDef formatting is not reapplied even though the ngOnChanges is triggered again just as before, and this.gridOptions.defaultColDef = this.defaultColDef; is set within the