Ember.js is an open-source JavaScript web framework, based on the Model–view–view model (MVVM) pattern. It allows developers to create scalable single-page web applications by incorporating common idioms and best practices into the framework.
From the beginning Ember was designed around several key ideas:
- Focus on ambitious web applications: Ember sets out to provide a wholesale solution to the client-side application problem. This is in contrast to many JavaScript frameworks that start by providing a solution to the V in MVC (Model–View–Controller), and attempt to grow from there.
- More productive out of the box: Ember is one component of a set of tools that work together to provide a complete development stack. The aim of these tools is to make the developer productive immediately. For example Ember CLI, provides a standard application structure and build pipeline. It also has a plug-gable architecture and over 3500 addons to enhance and extend it.
- Stability without stagnation: This is the idea that backward compatibility is important and can be maintained while still innovating and evolving the framework.
- Future web standards foresight: Ember has been an early adopter and pioneer of many standards around JavaScript and the web including promises, web components and ES6 syntax. Yehuda Katz, one of Ember’s co-founders, is a member on TC39, which is the committee responsible for future versions of the JavaScript language.
Ember consists of five key concepts:
- Routes
- In Ember, the state of an application is represented by a URL. Each URL has a corresponding route object that controls what is visible to the user.
- Models
- Every route has an associated model, containing the data associated with the current state of the application. 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.
- Templates
- Templates are used to build the application’s HTML and are written with the HTML Bars templating language. (HTML Bars is a variation of Handlebars that builds DOM elements rather than a String.)
- Components
- A component is a custom HTML tag. Behavior is implemented using JavaScript and its appearance is defined using HTML Bars templates. Components “own” their data. They can also be nested and can communicate with their parent components through actions (events). Other component libraries such as Polymer can also be used with Ember.
- Services
- Services are just singleton objects to hold long-lived data such as user sessions.
Ember also provides dependency injection, declarative two-way data binding, computed properties, and automatically-updating templates.
The above is a brief about Ember.js. Watch this space for more updates on the latest trends in Technology.