Ember has a super powerful router and the framework strongly emphasizes the importance of URLs. Some other JavaScript frameworks don't update the URL to reflect the current state of the app, this means that the back button doesn't work.
Ember brings in it's own class-based inheritance system with support for super
and other goodies.
The Ember object model also has support for computed properties, which are super cool. Computed properties are dynamically generated from other properties in the object.
var Person = Ember.Object.extend({
firstName: 'Steve',
lastName: 'Kinney',
fullName: function () {
return this.get('firstName') + ' ' + this.get('lastName');
}.property('firstName', 'lastName')
});
If either first name or last name changes, the fullName
computed property is recomputed. The other really cool thing is that if both firstName
and lastName
changes, fullName
is still only recomputed once because Ember is smart enough to wait until the event loop completes before recomputing everything.
If something changes in your model or controller, it's instantly reflected in the browser. If something changes in the DOM, it's instantly reflected in your model or controller. Pretty awesome.
Web components are custom HTML elements that encapsulate functionality and appearance. Their coming to the HTML spec, but you can use them now in Ember.
http://emberjs.com/guides/components/
The Ember team is focused on creating a great experience for developers. ember-cli
gives you a full toolchain for creating Ember apps easily. Just type ember new
in the command line. ember-cli
also allows you to generate models and controllers, just like in Rails. Additionally, it let's you use ES6 features like classes and modules in a way that compiles down to JS that is compatible as far back as IE6!