Getting Into Ember.js: Part 3

Accessing and managing data within Ember

Rey Bango hopes that you’re starting to see that Ember.js is a powerful, yet opinionated, framework. We’ve only scratched its surface; there’s more to learn before we can build something truly useful! We’ll continue using the Ember Starter Kit. In this portion of the series, we’ll review accessing and managing data within Ember.

 

In the last article, we worked with a static set of color names that were defined within a controller:

App.IndexRoute = Ember.Route.extend({
 setupController: function(controller) {
   controller.set('content', ['red', 'yellow', 'blue']);
 }
});

This allowed the controller to expose the data to the index template. That’s cute for a demo, but in real life, our data source will not be a hard-coded array.

This is where models comes in. Models are object representations of the data your application uses. It could be a simple array or data dynamically retrieved from a RESTful JSON API.

Lubov Cholakova

Lubov CholakovaLubov has been with DMXzone for 8 years now, contributing to the Content and Sales departments. She is bringing high quality content in the form of daily blog updates, reviews, tutorials, news, newsletters,update emails and extensions' manuals. If you have a product that needs publicity or any other questions about the entire DMXzone community, she is the one you can contact.

See All Postings From Lubov Cholakova >>

Comments

Be the first to write a comment

You must me logged in to write a comment.