1

I'm using Angular 5 and mattlewis92/angular-calendar. when events are defined manually in code i have no issue. However when i query my database and try to bind the result to the calender, there seem to be som kind of sync issue on first load. when i do an 'onlick', everything gets up to date.

It seems that the calendar is not that reactive. My guess is that it the observable returns the objects to late.

please se the gif that illustrates the problem http://gph.is/2ELyvDs

Thanks

2 Answers 2

1

I commented out changeDetection and everything seems to work fine now.

@Component({
   selector: 'mwl-demo-component',
   // changeDetection: ChangeDetectionStrategy.OnPush,
   templateUrl: 'bookingcalendar.component.html'
})
Sign up to request clarification or add additional context in comments.

2 Comments

I have a similar problem, my data is not shown until I change my view to week or day. If I change the route and return, I have to do the same to show them, could you share your code to guide me?
I have the same problem and comment changeDetection didn1t solve my problem. My complete code and a good explanation is here: stackoverflow.com/questions/55365513/…
0

I have seen a few answers for this. Adding encapsulation: ViewEncapsulation.None, also, adding this.refresh.next, but these weren't working for me. However, what I realised was that it was taking a bit of time for the events to be retrieved from a database so this.refresh.next worked after a timeout.

   setTimeout(() => 
{
this.refresh.next();

},
900);

}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.