Ember.js: Difference between revisions
m Update infobox with 1.4.0 release |
Fix capitalization and edit Basic Concepts content |
||
Line 20: | Line 20: | ||
=== Routes === |
=== Routes === |
||
The router is a core concept of Ember, emphasizing the importance of the URL in managing application state. A route object corresponds to a URL and essentially serializes the application's current state.<ref>{{cite web |url=http://emberjs.com/guides/routing/ |title=Ember.js - Routing: Introduction |publisher=emberjs.com |accessdate=21 Jan 2014}}</ref> |
|||
=== Models === |
=== Models === |
||
Every route has an associated |
Every route has an associated model, containing the data associated with the current state of the application.<ref>{{cite web |url=http://emberjs.com/guides/models/ |title=Ember.js - Models: Introduction |publisher=emberjs.com |accessdate=21 Jan 2014}}</ref> While one can use [[jQuery]] to load [[JSON]] objects from a server and use those objects as models,most applications use a model library such as Ember Data to handle this. |
||
=== Controllers === |
=== Controllers === |
||
Controllers are used to decorate models with display logic.<ref>{{cite web |url=http://emberjs.com/guides/controllers/ |title=Ember.js - Controllers: Introduction |publisher=emberjs.com |accessdate=21 Jan 2014}}</ref> A controller typically inherits from ObjectController if the template is associated with a single model record |
Controllers are used to decorate models with display logic.<ref>{{cite web |url=http://emberjs.com/guides/controllers/ |title=Ember.js - Controllers: Introduction |publisher=emberjs.com |accessdate=21 Jan 2014}}</ref> A controller typically inherits from ObjectController if the template is associated with a single model record and ArrayController if the template is associated with a list of records.<ref>{{cite web |url=http://emberjs.com/guides/controllers/representing-multiple-models-with-arraycontroller/ |title=Ember.js - Controllers: Representing Multiple Models With ArrayController |publisher=emberjs.com |accessdate=21 Jan 2014}}</ref> |
||
=== Templates === |
=== Templates === |
||
Templates are written with the [[Handlebars (template system)|Handlebars]] templating language to describe the user interface. Templates are used to build the application's HTML and embed dynamically-updating expressions.<ref>{{cite web |url=http://emberjs.com/guides/templates/handlebars-basics/ |title=Ember.js - Templates: Handlebars Basics |publisher=emberjs.com |accessdate=15 Feb 2014}}</ref> |
|||
Templates are written using [http://handlebarsjs.com/ Handlebars] and are used to dynamically build the HTML used throughout the application. |
|||
=== Views === |
=== Views === |
||
Views are used to add sophisticated handling of user events |
Views are used to add sophisticated handling of user events or reusable behavior to a template.<ref>{{cite web |url=http://emberjs.com/guides/views/ |title=Ember.js - Views: Introduction |publisher=emberjs.com |accessdate=21 Jan 2014}}</ref> |
||
=== Components === |
=== Components === |
||
Components are a specialized view for creating custom elements that can be easily reused in templates.<ref>{{cite web |url=http://emberjs.com/guides/components/ |title=Ember.js - Components: Introduction |publisher=emberjs.com |accessdate=21 Jan 2014}}</ref> |
Components are a specialized view for creating custom elements that can be easily reused in templates. The Ember Components implementation conforms as closely as possible to the W3C [http://www.w3.org/TR/components-intro/ Web Components] specification.<ref>{{cite web |url=http://emberjs.com/guides/components/ |title=Ember.js - Components: Introduction |publisher=emberjs.com |accessdate=21 Jan 2014}}</ref> |
||
== Ember Data == |
== Ember Data == |
Revision as of 00:40, 16 February 2014
Ember.js logo | |
Developer(s) | Yehuda Katz, Tom Dale and Ember.js contributors |
---|---|
Initial release | 2011 |
Stable release | 1.4.0
/ February 13, 2014 |
Repository | |
Written in | JavaScript |
Operating system | Cross-platform |
License | MIT License |
Website | emberjs |
Ember.js is an open-source client-side JavaScript web application framework based on the model-view-controller (MVC) software architectural pattern. It allows developers to create scalable single-page applications[1] by incorporating common idioms and best practices into a framework that provides a rich object model, declarative two-way data binding, computed properties, automatically-updating templates powered by Handlebars.js, and a router for managing application state.[2]
Basic Concepts
Routes
The router is a core concept of Ember, emphasizing the importance of the URL in managing application state. A route object corresponds to a URL and essentially serializes the application's current state.[3]
Models
Every route has an associated model, containing the data associated with the current state of the application.[4] While one can use jQuery to load JSON objects from a server and use those objects as models,most applications use a model library such as Ember Data to handle this.
Controllers
Controllers are used to decorate models with display logic.[5] A controller typically inherits from ObjectController if the template is associated with a single model record and ArrayController if the template is associated with a list of records.[6]
Templates
Templates are written with the Handlebars templating language to describe the user interface. Templates are used to build the application's HTML and embed dynamically-updating expressions.[7]
Views
Views are used to add sophisticated handling of user events or reusable behavior to a template.[8]
Components
Components are a specialized view for creating custom elements that can be easily reused in templates. The Ember Components implementation conforms as closely as possible to the W3C Web Components specification.[9]
Ember Data
Most Ember.js applications use Ember Data, a data persistence library that maps client-side models to server-side data, although it is also possible to use Ember.js without Ember Data.[10] By default, Ember Data can load and save records and their relationships without any configuration via a RESTful JSON API that follows certain conventions,[11] providing many of the facilities of an ORM, but it is also easily configurable and can work with any server through the use of adapters. Ember Data is currently in beta and its API should not be considered stable until version 1.0.[12]
History
In December 2011, the SproutCore 2.0 framework was renamed to Ember.js, to reduce confusion between the application framework and the widget library of SproutCore 1.0.[13][14] The framework was created by Yehuda Katz, a member of the jQuery, Ruby on Rails and SproutCore core teams. Like many of Katz's other projects, it advocates for convention over configuration.
For a full calendar of release dates, view the Ember Release Notes
References
- ^ Aghassipour, Alexander; Chacko, Shajith (30 Nov 2012). "Enterprise Apps Are Moving To Single-Page Design". TechCrunch.
- ^ Bango, Rey (14 Mar 2013). "Getting Into Ember.js". Nettuts+.
- ^ "Ember.js - Routing: Introduction". emberjs.com. Retrieved 21 Jan 2014.
- ^ "Ember.js - Models: Introduction". emberjs.com. Retrieved 21 Jan 2014.
- ^ "Ember.js - Controllers: Introduction". emberjs.com. Retrieved 21 Jan 2014.
- ^ "Ember.js - Controllers: Representing Multiple Models With ArrayController". emberjs.com. Retrieved 21 Jan 2014.
- ^ "Ember.js - Templates: Handlebars Basics". emberjs.com. Retrieved 15 Feb 2014.
- ^ "Ember.js - Views: Introduction". emberjs.com. Retrieved 21 Jan 2014.
- ^ "Ember.js - Components: Introduction". emberjs.com. Retrieved 21 Jan 2014.
- ^ "Ember without Ember Data". Evil Trout. Retrieved 2 Jan 2014.
- ^ "Ember.js Models". emberjs.com. Retrieved 4 Dec 2013.
- ^ "Ember Data README". Retrieved 4 Dec 2013.
- ^ "SproutCore 2.0 becomes Ember.js". The H. 13 Dec 2011.
- ^ "Amber.js (formerly SproutCore 2.0) is now Ember.js". yehudakatz.com. 12 Dec 2011.