What is Ember?
Ember.js is an Open source framework for front-end development, which means that it helps you create the design and logic that the website user interacts with Ember is a JavaScript front-end framework designed to help you build websites with rich and complex user interactions. It does so by providing developers both with many features that are essential to manage complexity in modern web applications, as well as an integrated development toolkit that enables rapid iteration. (SproutCore MVC framework is old name of EmberJS)
Why emper.js?
- Ember.js is an open-source JavaScript framework
- Built-in Best Practices
- Ember is the WordPress of JavaScript
- Convention over configuration
- Productivity improvement
- Amazing Features
- Data binding Support
- Glimmer rendering engine to increase the rendering speed.
What are the five key concepts in Ember consists?
Routing: The router is the object responsible for managing application state. When your user starts your application, it will look at the URL and make sure that the right set of templates is displayed, as well as pairing those templates with the right model objects.
Templates: Templates are written with the Handlebars templating language to describe the user interface. This handle bars can generate html tags with the related content automatically by using expressions with helpers.
Models: A model is an object that stores persistent state. This is the data that your application operates on and what gives it value to your users. These objects are usually loaded from your server, then saved back when changes are made on the client.
Components: Components allow for the creation of reusable controls. The interface for the component is defined using Handlebars templates. The component also has a JavaScript class that is used to store state and handle user interaction. Components are placed into a template using a Handlebars helper with a name based off of the name of the component.
Controllers: Controllers are used to decorate models with display logic. A controller typically inherits from Object Controller if the template is associated with a single model record and Array Controller if the template is associated with a list of records.
What are the features of Ember.js?
- It is used for creating reusable modules.
- It provides the instance initializers.
- The routes are core features of the Ember.js which are used for managing the URL’s.
- It provides Ember Inspector tool for debugging Ember applications.
- It has HTML and CSS at the core of the development model.
- It uses templates that help to automatically update the model, if the content of applications gets changed.
- Extensive view type support.
What are the key Components of Ember.js?
- Models
- The Router
- Controllers
- Views
- Components
- Templates
- Helpers
What are different template components in Ember.js?
- Partial
- View
- Render
- Yield
- Outlet
What is the difference between Router and Route in Ember.js?
Router: It is the connecting point between browser’s address bar and our application. It translates address into Route
Route: It is where a user request will land after it was translated by a Router. Route decides what data should be provided to the Template
What is Views in Ember.js?
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.
What is Enumerables in Ember.js?
Enumerable is any object that contains a number of child objects and enables you to work with those children using the Ember.
What is Ember.Namespace.Class ?
It is used to define an object which contains other objects and data.
What is ember.mixin class?
Ember.mixin class can create objects, whose functions and properties can be shared among other instances and classes. This will help to share behaviour between objects as well as design objects.
What Is Ember-data?
Ember-Data is a library that retrieve records from a server, store them, and update them in the browser and save them back to the server.
What is Ember.ArrayController?
It is known a type of controller that wraps an underlying array and adds additional functionality for the view layer.
Can you define Ember Application Template?
Application Template is a default template used when application starts in Ember.
How ember applications are structured?
The application ember.js is based on MVC (Model, View, and Controller) structure
Models: It defines the data that is used in an application
Controllers: It modifies query and edit the data and provide user interactions
Views: It display the data and capture user actions.
How Ember.js is different than traditional web application?
In Ember.js, instead of majority of your application’s logic living on the server, an ember.js application downloads everything it required to run in the initial page load. So user does not have to load a new page while using the app and UI will responds quickly. The advantage of this architecture is that your web application uses the same REST API as your native App.
What is Adapter in Ember?
In Ember Data, the Adapter determines how data is persisted to a backend data store, such as the URL format and headers for a REST API. (The format of the data itself is determined by the serialize.) Ember Data’s default Adapter has some built-in assumptions of how a REST API should look. If your backend conventions differ from these assumptions Ember Data makes it easy to change its functionality by swapping out or extending the default Adapter.
What is Ember Namespace?
Sometimes an object contains application of a framework. Defining the same object is a daunting job because it cannot be directly accessed. For this purpose, Ember namespace can be used.
How you can add data using fixture into an application?
In order to put sample data into an application before connecting the application to long term persistence, fixtures are used.
First update js/application.js to indicate that your application’s application adapter is an extension of the DS.FixtureAdapter. Adapters are used for communicating with a source of data for your application. Usually, this will be a web service API.
Next, update the file at js/models/todo.js
What are the two ways of defining and inserting a view?
First way: By extending the Em.View class, you have to create an object in your JavaScript to define a view. You can declare your functions and variables inside that. Now to insert a view in your template, you have to follow the write the handlebar script {{#view App.ViewName}}
Second Way: In this technique, the name of the view object is not required, while inserting into the template. But inside the object you have another property called as template Name which should be initialized with the value same as data template name attribute in handlebar’s script tag, in your template.
What are different testing in Ember.Js?
Testing is a core part of the Ember framework and its development cycle. There are three types of testing available in Ember.js:
- Acceptance Tests: It is used to test user interaction and application flow.
- Unit Tests: It is used to test isolated chunks of functionality, or “units”.
- Integration Tests: This test serves as a middle ground between acceptance tests.
What are the Pros and cons of Ember.js?
Pros:
- A lot of community modules and relatively popular
- Nested UIs.
- Minimizes DOM.
- URL-support.
- Easy to share the templates between server and client side rendering.
- Faster boot times and inherent stability.
- Two-way data binding is easier than dirty checking
Cons:
- Not as powerful as AngularJS and more difficult to learn than Angular JS
- Due to a helper function, two-way data binding is more complex.
- Ember’s object model implementation bloats Ember’s overall size and call stack while debugging.
- The most opinionated and heaviest of the frameworks.
- Testing story seems vague/incomplete.
- Overblown for small projects.
What is difference between Angular/ React /Backbone / Ember?
Angular.Js: Angular is an open-source web application framework with Model-View-Controller (MVC) architecture (Angular 1) and Model-View-ViewModel (MVVM) architecture (Angular 2), powered by Google. It is the oldest of the three frameworks named above. As the result, it has the largest community. Angular.js solves the problem of developing SPA’s (single page applications) by extending the functionality of HTML with directives. The framework places an emphasis on getting your app up and running quickly
React.Js: React is an open-source JavaScript library for building performant user interfaces with a focus on amazing rendering performance, introduced and powered by Facebook. React is main focused on “V” in Model View Controller architecture. After React was first announced, it quickly achieved critical mass. It was built in order to solve the common problem with other JavaScript frameworks – efficient rendering of large data sets.
Backbone.Js: Backbone is the very small weight and full featured JavaScript framework. It helps developers to build apps within no time. It is so flexible that by writing code or using third party JavaScript framework, you can build anything on top of it. In short, this framework will help you to build a single web page application without offering too much complexity. Backbone is framework for simple web applications.
Ember.Js: Ember is the open source JavaScript framework and very similar to Angular JS. This framework has an active community of developers and suitable to build interactive front-end user interfaces. It also rides on the principal of two-way data binding like Angular JS. You can extend HTML with your own tags by using the concept of web component. Ember framework is used when you don’t need flexibility because you are on tight budget and deadlines.