O'Reilly logo

Instant Ember.js Application Development How-to by Marc Bodmer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Handling external data (Advanced)

Hardcoded data in your application is okay for demo purposes, but will most likely not work when developing real applications. Instead, we can figure out some way to retrieve external data.

How to do it...

Static data is fine for a simple application, but eventually we want to implement a way where we can import dynamic data into our application.

  1. We can create a JavaScript file called helpers.js. In it, we will have code as shown in the following snippet:
    MovieTracker.GetMovieItems = function() { MovieTracker.moviesController.addItem(MovieTracker.Movie.create({ title: 'The Avengers', rating: 4, watched: false })); MovieTracker.moviesController.addItem(MovieTracker.Movie.create({ title: 'Spiderman', rating: 1, watched: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required