Components - Only rendering on the first view


#1

I’m not sure If I am using components in the correct way. I’ve hacked away at them over the last few days and have been able to get Highcharts to render and display with no issues. I’m really impressed with how I was able to abstract them away but I still can’t overcome one hurdle I’ve been having. The components will only render on the first view. Every view after that will just be completely blank.

I have looked at the API and I understand that didInsertElement will only fire on the first rendering of a view. I cannot seem to find an event to hook into that would fire my render on subsequent load.

TLDR: New with components and they will only render on the first view


#2

Can you JSBin your highchart component, I’ve implemented several without any trouble. I can post an example when i get to work.


#3

I just wanted to report back that I solved my problem. It took making a few different components to realize that the crux of my problem was a lack of my knowledge using ember app kit.

I thought that in order to register a component as a helper I had to use

Ember.Handlebars.registerBoundHelper('humidity-chart', HumidityChart);

Which turns out to not be the case as they are automagically registered. Ember wouldn’t balk at the extra register, but it would prevent it from rendering on the second load without any warning. I hope this helps anyone else learning Ember.