1

I would like to know how do you force a component's re-rendering in Angular 2?

Thanks Dave

Dave
  • 332
  • 1
  • 5
  • 23
  • Possible duplicate of [Triggering Angular2 change detection manually](http://stackoverflow.com/questions/34827334/triggering-angular2-change-detection-manually) – eko Dec 08 '16 at 08:17
  • Possible duplicate (maybe even more similar than from @echonax): http://stackoverflow.com/questions/35105374/how-to-force-a-components-re-rendering-in-angular-2 – Petr Adam Dec 08 '16 at 08:27
  • Its similar but does not actually address how to re-render a component. I am able to update the values in the components UI but I need to re-render the component to allow an external JS library to act upon the new changes. Any suggestions? – Dave Dec 08 '16 at 08:31
  • @PetrAdam This might work... – Dave Dec 08 '16 at 08:36
  • *ngIf the component, set the flag to false, call the changedetectorref, than set the flag to true in setTimeout.. this is as dirty as possible and very bad but it worked :( – Denko Mancheski Dec 08 '16 at 09:04
  • The other suggestions didn't work as the values did update in the UI but the component does not re-render... Thanks @DenkoMancheski I'll give this a shot! – Dave Dec 08 '16 at 09:09
  • Going to change approach as there does not seem to be a clean way to implement what I'm looking for... Its seems like a simple task to fully re-render the component view... – Dave Dec 08 '16 at 09:20

0 Answers0