concept model in category ember

appears as: model, models, models, The models, model, A model
Ember.js in Action

This is an excerpt from Manning's book Ember.js in Action.

As you can guess, this approach is inefficient, and it significantly increases the number of HTTP requests that the client sends to the server. This is where the power of Ember.js comes into play. As a developer, you probably understand the issues with the model presented in figure 1.3, in which the server side returns the updated markup for single elements on the page. To update multiple elements, you need to take one of the following approaches:

You’ll use the model() hook for the talks and the talks.talk routes to tell the application’s data layer to fetch data from the server.

The following listing shows how to use the model() function to fetch the application’s talks and load them into the Emberfest.TalksController.

Listing 6.2. TalksRoute

The code looks pretty simple, right? As it should! You return the result of fetching all the talks from the server from the model() function. Ember Router injects this data into the content property of the correct controller, in this case the Talks-Controller.

Ember.js calls the model() function when the talks route is created. This prevents additional calls to the findAll() function and reduces the traffic between the client and the server.