How do I force Ember to re-migrate a component?

I have an Ember component that uses jQuery to add a canvas chart. When I change routes I get a new model, but Ember's auto-rendering doesn't work in this case. Actually, I don't know how to make the component code that adds a rerun of the diagram. How can i do this?

Would it work better if it was an opinion?

+3


source to share


1 answer


Without looking at the code, I'm going to guess based on your model change statement.

Component Currently

uiSetup: function(){
   // do magic here...
}.on('didInsertElement')

      



Observation component

Assuming the model in the component is called a model, this will fire whenever the model changes, as well as when the element was originally inserted into the page. You can also split it into two separate functions if you need them to have different effects on modifying the model and the first-inserted element.

uiSetup: function(){
   // do magic here...
}.on('didInsertElement').observes('model') 

      

+7


source







All Articles