Ember.js

Ember.js bills itself as the framework for creating ambitious web applications. Ember's goal is to target fairly large-scale SPAs, so the idea of using it to build something very simple might seem like overkill, but it is certainly doable. A fair assessment is to take a look at the production file size of the Ember library, which comes in at around 90 KB (versus 6.5 KB for Backbone.js). That being said, if you are building something very robust with a very large code base, the added 90 KB might not be a big deal for you.

Here is a very small sample application using Ember.js:

var App = Ember.Application.create(), 
    movies = [{ 
        title: "Big Trouble in Little China", 
        year: "1986" 
    }, { 
        title: "Aliens", 
        year: "1986" 
    }]; 
 
App.IndexRoute = Ember.Route.extend({ 
    model: function() { 
        return movies;  
    } 
}); 
 
<script type="text/x-handlebars" data-template-name="index"> 
    {{#each}} 
        {{title}} - {{year}}<br/> 
    {{/each}} 
</script> 

Ember.js's code looks somewhat similar to that of Backbone.js, and it's no surprise that a lot of seasoned Backbone.js developers find themselves migrating to Ember.js as their need for more robust solutions increases. Ember.js uses familiar items, including views, models, collections, and routes, as well as an Application object.

Additionally, Ember.js features components, which is one of its more powerful and beloved features. Giving a sneak preview of the future of the web, components allow you to create small, modular, reusable HTML components that you can plug into your application as needed. With components, you can basically create your own custom HTML tags that look and behave exactly how you define them, and they can be reused easily throughout an application.

Developing with Ember.js is all about convention. Unlike Backbone.js, Ember.js tries to get a lot of the boilerplate out of the way and makes certain assumptions for you. Because of this, you need to do things a certain way, and controllers, views, and routes need to follow a somewhat strict pattern with regards to naming conventions.

The Ember.js website features incredible online documentation and Getting Started guides. If you're interested in learning more about Ember.js, check it out at http://emberjs.com/guides/. Also, don't forget to take a look at the TodoMVC implementation!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.144.216