Angular-calendar: Asynchronus beforeViewRender method

Created on 23 Jan 2019  路  1Comment  路  Source: mattlewis92/angular-calendar

Describe the bug

I wanted to modifiy the weekDay cssClass property depending on http request/response. Just modify the div background color. The problem is when I charge the component, it doesn't paint the cells, but if I click on a day, for example, it does it. But i want to paint when charge the mwl-calendar-month-view component, even when i change the month, i wanted to re-paint it with the information get it from my http request with this new date (got it from the viewDate property).
Thank you.

Screenshots

I have this on my HTML.

image

My component.ts

image

And my service.ts

image

Versions

  • @angular/core: 6.1.4
  • angular-calendar: 0.26.4
  • Browser name and version: Google Chrome Version 71.0.3578.98

Most helpful comment

Solved adding:

In my component.ts

Injecting the ChangeDetectorRef in my component constructor:

image

Calling the method detectChanges of this ChangeDetectorRef after my http response:

image

>All comments

Solved adding:

In my component.ts

Injecting the ChangeDetectorRef in my component constructor:

image

Calling the method detectChanges of this ChangeDetectorRef after my http response:

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

agilob picture agilob  路  3Comments

chaouiy picture chaouiy  路  3Comments

sylvain-fr picture sylvain-fr  路  3Comments

Seb69 picture Seb69  路  3Comments

AstRonin picture AstRonin  路  4Comments