Closed coldiary closed 7 years ago
@coldiary Sorry for the delay! I'm traveling at the moment. Thank you for your efforts!
No problem. I actually thought it was pretty fast, since I didn't contribute to any project before. It came quick, in my opinion. Glad you found it useful !
Le 3 déc. 2016 à 11:24, Paul Moff notifications@github.com a écrit :
@coldiary Sorry for the delay! I'm traveling at the moment. Thank you for your efforts!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Hi !
I was experiencing some inconsistent refreshes upon adding multiple flash messages simultaneously with the show method. View did not refresh as supposed to.
So here is a little fix, if you approve it :
Explicitly trigger refresh of the component view using ChangeDetectorRef
private _cdRef
detectChanges()
on_cdRef
private member after insertion and removal of a message in order to explicitly refresh the view.Note: I'm choosing ChangeDetectorRef rather than
zone.run()
in order to detect component and children changes, and not traversing the entire tree. But if changes were about to happen outside the module, the second solution would be preferable.