SlideShare a Scribd company logo
Introduction to Ember.JS
Getting Started to Develop ambitious web
applications.
Agenda
• Why JavaScript
• About Ember.JS
• Application Architecture
• Responsive Web Design
• Development Workflow
• Unit Testing
• Build Tools
• Debugging
Why JavaScript
• Supported by all modern browsers
• Mobile Browsing
• JavaScript is great at event driven apps
• Instant Feedback – Users hate staring at the
blank loading page
• Minimal data transfer
• Reduced load on the server
About Ember.JS
● The first thing to keep in mind is that Ember.js is not a framework
for building traditional websites
● Ember leverages the MVC pattern for promoting proper code
management and organization
● Ember relies on client-side templates
● Ember.js relies on the following additional libraries
○ Handlerbars
○ jQuery
<script src="js/libs/jquery.js"></script>
<script src="js/libs/handlebars.js"></script>
<script src="js/libs/ember.js"></script>
<script src="js/app.js"></script>
Creating An Application
• The first step to creating an Ember.js application is to make an
instance of Ember.Application and assign it to a global variable
• All of the classes in your application will be defined as properties
on this object (e.g., App.PostsView and App.PostsController).
• It adds event listeners to the document and is responsible for
delegating events to your views.
• It automatically renders the application template.
• It automatically creates a router and begins routing, choosing
which template and model to display based on the current URL.
window.App = Ember.Application.create();
Controllers
● A controller is an object that stores application state. A template
can optionally have a controller in addition to a model, and can
retrieve properties from both.
● Controller just acts as a pass-through (or "proxy") for the model
properties
App.ApplicationController = Ember.Controller.extend({
firstName: "Trek",
lastName: "Glowacki"
});
Routing
● In Ember.js, each of the possible states in your application is
represented by a URL
● At any given time, your application has one or more active route
handlers. The active handlers can change for one of two reasons:
○ The user interacted with a view, which generated an event that caused the
URL to change.
○ The user changed the URL manually (e.g., via the back button), or the page
was loaded for the first time.
● When the user visits /about, Ember.js will render the about
template. Visiting /favs will render the favorites template.
App.Router.map(function() {
this.route("about", { path: "/about" });
this.route("favorites", { path: "/favs" });
});
Views(Templates)
● A template, written in the Handlebars templating language,
describes the user interface of your application. Each template is
backed by a model, and the template automatically updates itself
if the model changes.
● In addition to plain HTML, templates can contain:
○ Expressions, like {{firstName}}, which take information from
the template's model and put it into HTML.
○ Outlets, which are placeholders for other templates. As users
move around your app, different templates can be plugged
into the outlet by the router. You can put outlets into your
template using the {{outlet}} helper.
○ Components, custom HTML elements that you can use to
clean up repetitive templates or create reusable controls
Expressions
● Each template has an associated controller: this is where the
template finds the properties that it displays.
● You can display a property from your controller by wrapping the
property name in curly braces, like this
● This would look up the firstName and lastName properties from
the controller, insert them into the HTML described in the
template, then put them into the DOM.
Hello, <strong>{{firstName}} {{lastName}}</strong>!
App.ApplicationController = Ember.Controller.extend({
firstName: "Trek",
lastName: "Glowacki"
});
Model
● A model is an object that stores persistent state. Templates are
responsible for displaying the model to the user by turning it into
HTML.
● In many applications, models are loaded via an HTTP JSON API,
although Ember is agnostic to the backend that you choose
● Many Ember apps use Ember Data to manages finding models,
making changes, and saving them back to the server
● Ember Data is a library that integrates tightly with Ember.js to
make it easy to retrieve records from a server, cache them for
performance, save updates back to the server, and create new
records on the client.
Model Contd.
• In Ember, every route has an associated model
App.IndexRoute = Ember.Route.extend({
model: function() {
return ['red', 'yellow', 'blue'];
}
});
<script type="text/x-handlebars" id="index">
<ul>
{{#each item in model}}
<li>{{item}}</li>
{{/each}}
</ul>
</script>
Naming Convention
● If we create a route, called "employees":
● Then name components, like this:
○ Route object: App.EmployeesRoute
○ Controller: App.EmployeesController
○ Model: App.Employee
○ View: App.EmployeesView
○ Template: employees
App.Router.map( function() {
this.resource( 'employees' );
});
Responsive Web Design
● With Web users increasingly using mobile devices to browse Web
sites and apps, Web designers and developers need to be sure
that their creations look as good and work as well on mobile
devices as on traditional desktop computers
● Some of its strategies include:
○ Liquid or fluid layout: Defining all container widths in terms of
percentages of the browser viewport, so that they expand and
contract as the browser window changes size.
○ Media queries: Invoking different style sheets based on the
capabilities of the display being used, such as size, resolution,
aspect ratio, and color depth.
○ Fluid images: Setting images to occupy at most the maximum
display width.
Development Workflow
● Editor - Brackets is unique in that it's an open-source code editor
developed by Adobe
● Build Tools - Grunt or Gulp
○ JS Lint and Unit testing
○ Pre - Processors
○ LiveReload
○ Minify
○ Bower - Dependency Management
Debugging the App
• Browser Dev tools & Console
• Ember Inspector - Chrome Extension
App = Ember.Application.create({
LOG_RESOLVER: true
});
Thank You!

More Related Content

PDF
Introduction to Angularjs : kishan kumar
PPTX
Angular js 1.3 presentation for fed nov 2014
PDF
Introduction of angular js
PDF
Angularjs architecture
PPTX
Angular JS Indtrodution
PPTX
AngularJs (1.x) Presentation
PPTX
Introduction to AngularJS
PPTX
Angular js
Introduction to Angularjs : kishan kumar
Angular js 1.3 presentation for fed nov 2014
Introduction of angular js
Angularjs architecture
Angular JS Indtrodution
AngularJs (1.x) Presentation
Introduction to AngularJS
Angular js

What's hot (20)

PPTX
Angularjs
PPTX
Angular js PPT
PDF
Introduction to AngularJS
PPTX
Angular JS - Introduction
PPTX
PPTX
Why angular js Framework
PDF
AngularJS: an introduction
PDF
[@NaukriEngineering] Flux Architecture
PDF
PPTX
Angular Js Get Started - Complete Course
PPT
Angular js
PDF
Dot net interview questions and asnwers
PDF
AngularJS application architecture
PPTX
ASP .NET MVC
PPTX
The Chaos Tools Suite
PDF
Introduction to AngularJS
PDF
Active Admin
PDF
Advanced Tips & Tricks for using Angular JS
PPT
Angular js
Angularjs
Angular js PPT
Introduction to AngularJS
Angular JS - Introduction
Why angular js Framework
AngularJS: an introduction
[@NaukriEngineering] Flux Architecture
Angular Js Get Started - Complete Course
Angular js
Dot net interview questions and asnwers
AngularJS application architecture
ASP .NET MVC
The Chaos Tools Suite
Introduction to AngularJS
Active Admin
Advanced Tips & Tricks for using Angular JS
Angular js
Ad

Viewers also liked (19)

PDF
Orginal Training Report
DOC
Ghazawi-CV updat - April 2016
PDF
2016 Roof Pricing Guide
PDF
แบบเสนอโครงร่างโครงงานคอมพิวเตอร์606
PDF
67+68 M5C2 Lezione 2. dalla costituzione ai giorni nostri
PPTX
Curso de informatica
PPTX
Koswer Piramid Makanan
KEY
Social media 3 the new world
PPTX
Social media and school communication
PPTX
Berlin vg deck and exercise
PPT
Los mares del mundo
ODP
Eines
PPTX
PPTX
【模擬投票×マニフェストスイッチ】概要説明資料
PDF
Chapter 5
PPSX
2012 betty & hkc
PPT
Green india
Orginal Training Report
Ghazawi-CV updat - April 2016
2016 Roof Pricing Guide
แบบเสนอโครงร่างโครงงานคอมพิวเตอร์606
67+68 M5C2 Lezione 2. dalla costituzione ai giorni nostri
Curso de informatica
Koswer Piramid Makanan
Social media 3 the new world
Social media and school communication
Berlin vg deck and exercise
Los mares del mundo
Eines
【模擬投票×マニフェストスイッチ】概要説明資料
Chapter 5
2012 betty & hkc
Green india
Ad

Similar to Introduction to Ember.js (20)

PPTX
Intoduction to Angularjs
PDF
Introduction to Angular Js
PPTX
Introduction to Angularjs
PPTX
Angular Javascript Tutorial with command
PPTX
Angular workshop - Full Development Guide
PDF
Create an application with ember
PPTX
Front end development with Angular JS
PPT
introduction to Angularjs basics
PPTX
Introduction to AngularJS
PPTX
The Basics Angular JS
PDF
AngularJS Basics
PPTX
AgularJS basics- angular directives and controllers
PPTX
4 Anguadasdfasdasdfasdfsdfasdfaslar (1).pptx
PPTX
Learning AngularJS - Complete coverage of AngularJS features and concepts
PDF
AngularJS 101 - Everything you need to know to get started
PPTX
Angularjs Basics
PPTX
Angular Js Basics
PPTX
Foster - Getting started with Angular
PDF
Angularjs 131211063348-phpapp01
Intoduction to Angularjs
Introduction to Angular Js
Introduction to Angularjs
Angular Javascript Tutorial with command
Angular workshop - Full Development Guide
Create an application with ember
Front end development with Angular JS
introduction to Angularjs basics
Introduction to AngularJS
The Basics Angular JS
AngularJS Basics
AgularJS basics- angular directives and controllers
4 Anguadasdfasdasdfasdfsdfasdfaslar (1).pptx
Learning AngularJS - Complete coverage of AngularJS features and concepts
AngularJS 101 - Everything you need to know to get started
Angularjs Basics
Angular Js Basics
Foster - Getting started with Angular
Angularjs 131211063348-phpapp01

Recently uploaded (20)

PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Cloud computing and distributed systems.
PDF
Electronic commerce courselecture one. Pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Spectroscopy.pptx food analysis technology
PPT
Teaching material agriculture food technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Programs and apps: productivity, graphics, security and other tools
Big Data Technologies - Introduction.pptx
Cloud computing and distributed systems.
Electronic commerce courselecture one. Pdf
MIND Revenue Release Quarter 2 2025 Press Release
Diabetes mellitus diagnosis method based random forest with bat algorithm
20250228 LYD VKU AI Blended-Learning.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Machine learning based COVID-19 study performance prediction
Spectroscopy.pptx food analysis technology
Teaching material agriculture food technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Spectral efficient network and resource selection model in 5G networks
Unlocking AI with Model Context Protocol (MCP)
Dropbox Q2 2025 Financial Results & Investor Presentation
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

Introduction to Ember.js

  • 1. Introduction to Ember.JS Getting Started to Develop ambitious web applications.
  • 2. Agenda • Why JavaScript • About Ember.JS • Application Architecture • Responsive Web Design • Development Workflow • Unit Testing • Build Tools • Debugging
  • 3. Why JavaScript • Supported by all modern browsers • Mobile Browsing • JavaScript is great at event driven apps • Instant Feedback – Users hate staring at the blank loading page • Minimal data transfer • Reduced load on the server
  • 4. About Ember.JS ● The first thing to keep in mind is that Ember.js is not a framework for building traditional websites ● Ember leverages the MVC pattern for promoting proper code management and organization ● Ember relies on client-side templates ● Ember.js relies on the following additional libraries ○ Handlerbars ○ jQuery <script src="js/libs/jquery.js"></script> <script src="js/libs/handlebars.js"></script> <script src="js/libs/ember.js"></script> <script src="js/app.js"></script>
  • 5. Creating An Application • The first step to creating an Ember.js application is to make an instance of Ember.Application and assign it to a global variable • All of the classes in your application will be defined as properties on this object (e.g., App.PostsView and App.PostsController). • It adds event listeners to the document and is responsible for delegating events to your views. • It automatically renders the application template. • It automatically creates a router and begins routing, choosing which template and model to display based on the current URL. window.App = Ember.Application.create();
  • 6. Controllers ● A controller is an object that stores application state. A template can optionally have a controller in addition to a model, and can retrieve properties from both. ● Controller just acts as a pass-through (or "proxy") for the model properties App.ApplicationController = Ember.Controller.extend({ firstName: "Trek", lastName: "Glowacki" });
  • 7. Routing ● In Ember.js, each of the possible states in your application is represented by a URL ● At any given time, your application has one or more active route handlers. The active handlers can change for one of two reasons: ○ The user interacted with a view, which generated an event that caused the URL to change. ○ The user changed the URL manually (e.g., via the back button), or the page was loaded for the first time. ● When the user visits /about, Ember.js will render the about template. Visiting /favs will render the favorites template. App.Router.map(function() { this.route("about", { path: "/about" }); this.route("favorites", { path: "/favs" }); });
  • 8. Views(Templates) ● A template, written in the Handlebars templating language, describes the user interface of your application. Each template is backed by a model, and the template automatically updates itself if the model changes. ● In addition to plain HTML, templates can contain: ○ Expressions, like {{firstName}}, which take information from the template's model and put it into HTML. ○ Outlets, which are placeholders for other templates. As users move around your app, different templates can be plugged into the outlet by the router. You can put outlets into your template using the {{outlet}} helper. ○ Components, custom HTML elements that you can use to clean up repetitive templates or create reusable controls
  • 9. Expressions ● Each template has an associated controller: this is where the template finds the properties that it displays. ● You can display a property from your controller by wrapping the property name in curly braces, like this ● This would look up the firstName and lastName properties from the controller, insert them into the HTML described in the template, then put them into the DOM. Hello, <strong>{{firstName}} {{lastName}}</strong>! App.ApplicationController = Ember.Controller.extend({ firstName: "Trek", lastName: "Glowacki" });
  • 10. Model ● A model is an object that stores persistent state. Templates are responsible for displaying the model to the user by turning it into HTML. ● In many applications, models are loaded via an HTTP JSON API, although Ember is agnostic to the backend that you choose ● Many Ember apps use Ember Data to manages finding models, making changes, and saving them back to the server ● Ember Data is a library that integrates tightly with Ember.js to make it easy to retrieve records from a server, cache them for performance, save updates back to the server, and create new records on the client.
  • 11. Model Contd. • In Ember, every route has an associated model App.IndexRoute = Ember.Route.extend({ model: function() { return ['red', 'yellow', 'blue']; } }); <script type="text/x-handlebars" id="index"> <ul> {{#each item in model}} <li>{{item}}</li> {{/each}} </ul> </script>
  • 12. Naming Convention ● If we create a route, called "employees": ● Then name components, like this: ○ Route object: App.EmployeesRoute ○ Controller: App.EmployeesController ○ Model: App.Employee ○ View: App.EmployeesView ○ Template: employees App.Router.map( function() { this.resource( 'employees' ); });
  • 13. Responsive Web Design ● With Web users increasingly using mobile devices to browse Web sites and apps, Web designers and developers need to be sure that their creations look as good and work as well on mobile devices as on traditional desktop computers ● Some of its strategies include: ○ Liquid or fluid layout: Defining all container widths in terms of percentages of the browser viewport, so that they expand and contract as the browser window changes size. ○ Media queries: Invoking different style sheets based on the capabilities of the display being used, such as size, resolution, aspect ratio, and color depth. ○ Fluid images: Setting images to occupy at most the maximum display width.
  • 14. Development Workflow ● Editor - Brackets is unique in that it's an open-source code editor developed by Adobe ● Build Tools - Grunt or Gulp ○ JS Lint and Unit testing ○ Pre - Processors ○ LiveReload ○ Minify ○ Bower - Dependency Management
  • 15. Debugging the App • Browser Dev tools & Console • Ember Inspector - Chrome Extension App = Ember.Application.create({ LOG_RESOLVER: true });