Jump to content

Ember.js: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Vine77 (talk | contribs)
m Update infobox with 1.11.3 release
Vine77 (talk | contribs)
m Update infobox with 1.11.3 release
Line 6: Line 6:
| status = Active
| status = Active
| latest release version = 1.11.3
| latest release version = 1.11.3
| latest release date = {{Start date and age|2015|04|014}}
| latest release date = {{Start date and age|2015|04|14}}
| operating system = [[Cross-platform]]
| operating system = [[Cross-platform]]
| programming language = [[JavaScript]]
| programming language = [[JavaScript]]

Revision as of 05:30, 20 April 2015

Ember.js
Developer(s)Yehuda Katz, Tom Dale and Ember.js contributors
Initial release2011 (2011)
Stable release
1.11.3 / April 14, 2015; 9 years ago (2015-04-14)
Repository
Written inJavaScript
Operating systemCross-platform
LicenseMIT License
Websiteemberjs.com

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 its own template library, HTMLBars (previously Handlebars.js),[2] and a router for managing application state.[3]

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. Routes are defined in the singleton Router object.[4]
Models
Every route has an associated model, containing the data associated with the current state of the application.[5] 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.[6] It was typical for a controller to inherit from ObjectController if the template was associated with a single model record and ArrayController if the template was associated with a list of records.[7] However, ObjectController and ArrayController have been deprecated in favor of explicitly accessing of the model property of Ember.Controller.[citation needed]
Templates
Templates are written with the HTMLBars templating language (a variation on the Handlebars template system[8]) to describe the user interface. Templates are used to build the application's HTML and embed dynamically-updating expressions.[9]
Views
Views are used to add sophisticated handling of user events, custom graphics not made with CSS, JavaScript animations, or reusable behavior to a template.[10]
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.[11]

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.[12] By default, Ember Data can load and save records and their relationships without any configuration via a RESTful JSON API that follows certain conventions,[13] 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.[14]

Ember Inspector

The Ember Inspector is an extension currently available for the Mozilla Firefox and Google Chrome web browsers that claims to make debugging Ember applications easier. Features include the ability to see which templates, controllers and models are currently rendered, see the properties of any Ember object with a UI that computes bindings and computed properties, and use the $E variable to access your application's objects from the console. If Ember Data is used, one can also see the records loaded for each model.[15]

Ember CLI

The ember-cli command line utility is a build tool for Ember.js based on broccoli. Features include ECMAScript 6 module syntax, dependency management through bower and npm, generators based on blueprints, and the ability of third parties to extend it via addons.[16] Ember CLI replaces the deprecated Ember App Kit.[17]

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.[18][19] 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.

References

  1. ^ Aghassipour, Alexander; Chacko, Shajith (30 Nov 2012). "Enterprise Apps Are Moving To Single-Page Design". TechCrunch.
  2. ^ Beale, Matthew. "EMBER.JS 1.10.0 AND 1.11 BETA RELEASED". http://emberjs.com. Retrieved 18 February 2015. {{cite web}}: External link in |website= (help)
  3. ^ Bango, Rey (14 Mar 2013). "Getting Into Ember.js". Nettuts+.
  4. ^ "Ember.js - Routing: Introduction". emberjs.com. Retrieved 21 Jan 2014.
  5. ^ "Ember.js - Models: Introduction". emberjs.com. Retrieved 21 Jan 2014.
  6. ^ "Ember.js - Controllers: Introduction". emberjs.com. Retrieved 21 Jan 2014.
  7. ^ "Ember.js - Controllers: Representing Multiple Models With ArrayController". emberjs.com. Retrieved 21 Jan 2014.
  8. ^ Jackson, Robert. "HTMLBars". GitHub. Retrieved 18 February 2015.
  9. ^ "Ember.js - Templates: Handlebars Basics". emberjs.com. Retrieved 15 Feb 2014.
  10. ^ "Ember.js - Views: Introduction". emberjs.com. Retrieved 21 Jan 2014.
  11. ^ "Ember.js - Components: Introduction". emberjs.com. Retrieved 21 Jan 2014.
  12. ^ "Ember without Ember Data". Evil Trout. Retrieved 2 Jan 2014.
  13. ^ "Ember.js Models". emberjs.com. Retrieved 4 Dec 2013.
  14. ^ "Ember Data README". Retrieved 4 Dec 2013.
  15. ^ "Chrome Web Store - Ember Inspector". Chrome Web Store. Retrieved 18 Feb 2014.
  16. ^ "Ember CLI Overview". Retrieved 20 Oct 2014.
  17. ^ "Why Ember CLI?". Retrieved 20 Oct 2014.
  18. ^ "SproutCore 2.0 becomes Ember.js". The H. 13 Dec 2011.
  19. ^ "Amber.js (formerly SproutCore 2.0) is now Ember.js". yehudakatz.com. 12 Dec 2011.