Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4828

Where to include client-side js that uses data from Ember-Data?

$
0
0

@amellnik wrote:

I have an existing Express/AngularJS application that I am working to port to Ember. This application pulls data from a server, then displays it in the form of a Plotly plot. In the original implementation I started with a page template (like this) which contained a javascript section like

Plotly.plot( TESTER, [{
  x: {{xdata}},
  y: {{ydata}}
}]);

When the user requested the page I would fetch the data and feed it to the template server-side so that the user was served something like

Plotly.plot( TESTER, [{
  x: [1,2,3],
  y: [1,4,9]
}]);

With Ember and Ember-Data, I can pull the same data into an Ember model, and if I want render those same arrays as text in the page using handelbars. However, I haven't been able to determine the proper Ember way to:

  • Include the plotting script in the page that is served to the client (or get the same effect somehow).
  • Hand the data off to that script

I think I'm sticking too closely to how I did this previously. What should this look like in Ember, or is this out of scope?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4828

Trending Articles