SlideShare a Scribd company logo
Getting into Ember.js
Rey Bango
@reybango
http://emberjs.com/
Abstract Complexities
MVC
Component relationships
Client-side templating
Binding
Caching
Leverage existing frameworks when possible
 jQuery (DOM)
 Handlebars (templates)
Opinionated
A little history
Experienced Team
Yehuda Katz
Creator of Merb
Rails Core Team
jQuery Core Team
Tom Dale
Apple MobileMe/iCloud
SproutCore Team
http://www.discourse.org/
https://github.com/discourse/discourse
Let‟s take a look…
Who is Ember for?
Good
 Dynamic apps
 Desktop-like feel
 Very little page refresh
Not Good
 Static sites
 Blogs
 Little user interaction
What We‟ll Cover
Core concepts of the framework
 Naming conventions
 Routers
 Templates
 Models
 Controllers
A basic app
What We Won‟t Cover
Ember vs Angular vs Knockout vs Kendo vs …
What We Won‟t Cover
Ember
Data
Is It "Production Ready™"?
No. The API should not be considered stable until 1.0.
Breaking changes, and how to update accordingly, are listed
in TRANSITION.md.
Core Concepts
Application Object
Application namespace
Add event listeners to the document
Automatically creates default components
Automatically renders the application template
var App =
Ember.Application.create({});
Application Object
Route object: App.ApplicationRoute
Controller: App.ApplicationController
View: App.ApplicationView
Template: application
var App =
Ember.Application.create({});
Let‟s take a look…
Ember Inspector
Browser add-on for Chrome & Firefox
See your routes
Inspect your objects
Ember Data records
Logging
App = Ember.Application.create({
LOG_TRANSITIONS:
true
});
Let‟s take a look…
Naming Conventions
Ties components together
Minimizes code
Allows Ember to do its magic
Learn them to make your life easier!!!
Naming Conventions
Route object: App.ApplicationRoute
Controller: App.ApplicationController
View: App.ApplicationView
Template: application
var App = Ember.Application.create({});
Naming Conventions
Route object: App.EmployeesRoute
Controller: App.EmployeesController
View: App.EmployeesView
Template: employees
this.resource( 'employees' );
Naming Conventions
Not part of the Ember API
De facto community standard
var App =
Ember.Application.create({});
What’s up with “App”?
The Router
The router manages the state of the application
Manages the location-specific routes
Marshalls request for resources to the appropriate location
Like a traffic cop directing traffic
App.Router.map( function()
{…});
Routes
 Takes us to “/#/about”
 Like the streets of your app
 Location-specific
 The URL is the key identifier
 Define the resources needed as a user navigates the app
 e.g.: a model that requests data
this.resource( 'about' );
Routes
App.Router.map( function() {
this.resource( accounts' ); // Takes us to
”/#/accounts“
this.resource( „gallery„ ); // Takes us to ”/#/gallery“
});
Route Aliases
http://embertalk:8888/#/aboutus
References the „about‟ route
this.resource( 'about‟, { path: „/aboutus‟ });
Route Objects
Do the heavy lifting for the routes
Customize the behavior of a route
Interface with models and controllers
App.GalleryRoute = Ember.Route.extend({
model: function() {
return App.GalleryPics.findAll();
}
});
Let‟s take a look…
Templates
Client-side parsed via JavaScript
Uses the Handlebars framework
Special directives act as placeholders for data
<script type=“text/x-handlebars” data-template-name=“sayhello”>
Hello, <strong>{{firstName}} {{lastName}}</strong>!
</script>
Templates
<script type=“text/x-handlebars” data-template-name=“sayhello”>
Hello, <strong>{{firstName}} {{lastName}}</strong>!
</script>
Template Expressions
Looping - {{#each}} directive:
<ul>
{{#each friend in model}}
<li>{{friend.name}} is my friend</li>
{{/each}}
<ul>
Template Expressions
Conditional Expressions – {{#if…}} directive:
{{#if person}}
Welcome back, <b>{{person.firstName}} {{person.lastName}}</b>!
{{else}}
Please log in.
{{/if}}
Template Expressions
Conditional Expressions – Can you do this?:
{{#if age >= 18}}
{{person.firstName}}, you‟re technically an adult!
{{else}}
Sorry youngster. Ask your parents for permission.
{{/if}}
Template Expressions
Conditional Expressions - Computed Property:
isOld: function() {
return this.get('age') > 45;
}.property()
{{#each person in model itemController='person'}}
<li>{{person.firstName}}, {{person.age}} {{#if isOld}} – Ready for Centrum
Silver!{{/if}}</li>
{{/each}}
Template Expressions
Bind attributes to HTML elements:
<img {{bindAttr src="link.thumbnailUrl"}} />
Renders this:
<img src=“kitten.png">
Can‟t I just do this?
<img src={{link.thumbnailUrl}} />
Template Expressions
Links:
{{#link-to 'about'}}About{{/link-to}}
Links to a route created in the router like this:
this.resource( 'about' );
Template Expressions
HTML Tags:
<ul>
{{#link-to 'about‟ tagName=„li‟}}About{{/link-to}}
</ul>
Styling:
{{#link-to 'about‟ class=“navitem”}}About{{/link-to}}
{{outlet}}
Special placeholder for other templates
<script type="text/x-handlebars" data-template-name="application">
{{outlet}}
</script>
Let‟s take a look…
Models
Interface with external APIs
Data is typically stored as JSON
Two ways to define them:
 Subclass of Ember.Object
 Ember Data
App.RedditLink =
Ember.Object.extend({…});
Models
http://www.reddit.com/r/cute/.json
{
"kind": "Listing",
"data": {
"modhash": "a1vty6l4kkc8e96de61136a717e96531a997ebdd8e36180519",
"children": [{
"kind": "t3",
"data": {
"domain": "imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "cute",
"selftext_html": null,
"selftext": "",
"likes": null,
"link_flair_text": null,
"id": "1b7h10",
"clicked": false,
"title": "First Easter away from my Mom, she still makes it special.",
"media": null,
"score": 6,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://f.thumbs.redditmedia.com/63tG_KTJIGF_Vwq5.jpg",
"subreddit_id": "t5_2qh5l",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 2,
Models
App.RedditLink = Ember.Object.extend({});
App.RedditLink.reopenClass({
findAll: function() {
var links = [];
$.getJSON("http://www.reddit.com/r/cute/.json?jsonp=?").then(function(res
ponse) {
response.data.children.forEach(function (child) {
links.pushObject(App.RedditLink.create(child.data));
});
});
return links;
Models
App.GalleryRoute = Ember.Route.extend({
model: function() {
return App.RedditLink.findAll();
}
});
 Links my model to the route & controller for the Gallery URL
 When a user goes to /gallery, the model is now available with data
 model is a keyword. It‟s a hook between the route, controller & the model
Controllers
Represent data from the model
Can store other data that needs to
persist
Templates are connected to controllers
Controllers may know of a model but not
the other way around
Created for you automatically if you don‟t
define one
Controllers
App.GalleryRoute = Ember.Route.extend({
setupController: function(controller) {
controller.set('content', ['red', 'yellow', 'blue']);
}
});
Controllers
App.GalleryController = Ember.ObjectController.extend({
// the initial value of the `search` property
search: ‟lastname‟,
isAnimal: function() {
return this.get(‟pictype') === „animal‟;
}.property()
});
Let‟s take a look…
Ember Reddit Demo…
Online Resources
http://emberjs.com
http://discuss.emberjs.com
http://handlebarsjs.com
http://emberwatch.com
Ember Online Learning
http://bit.ly/CStrialenrollment
$9/First Month
Follow these peeps
@wycats
@tomdale
@trek
@wagenet
@evil_trout
@codinghorror
@commadelimited
@emberwatch
Fin…

More Related Content

What's hot

David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
Codemotion
 
Introduction to Ember.js
Introduction to Ember.jsIntroduction to Ember.js
Introduction to Ember.js
Jeremy Brown
 
jQuery and Rails: Best Friends Forever
jQuery and Rails: Best Friends ForeverjQuery and Rails: Best Friends Forever
jQuery and Rails: Best Friends Forever
stephskardal
 
Single Page Web Apps with Backbone.js and Rails
Single Page Web Apps with Backbone.js and RailsSingle Page Web Apps with Backbone.js and Rails
Single Page Web Apps with Backbone.js and Rails
Prateek Dayal
 
[2015/2016] JavaScript
[2015/2016] JavaScript[2015/2016] JavaScript
[2015/2016] JavaScript
Ivano Malavolta
 
Intro to BackboneJS + Intermediate Javascript
Intro to BackboneJS + Intermediate JavascriptIntro to BackboneJS + Intermediate Javascript
Intro to BackboneJS + Intermediate JavascriptAndrew Lovett-Barron
 
Views
ViewsViews
Apex & jQuery Mobile
Apex & jQuery MobileApex & jQuery Mobile
Apex & jQuery Mobile
Christian Rokitta
 
BackboneJS Training - Giving Backbone to your applications
BackboneJS Training - Giving Backbone to your applicationsBackboneJS Training - Giving Backbone to your applications
BackboneJS Training - Giving Backbone to your applications
Joseph Khan
 
Rails course day 7
Rails course day 7Rails course day 7
Rails course day 7
Al Sayed Gamal
 
Handlebars & Require JS
Handlebars  & Require JSHandlebars  & Require JS
Handlebars & Require JS
Ivano Malavolta
 
Finding unused code in your Rails app
Finding unused code in your Rails appFinding unused code in your Rails app
Finding unused code in your Rails app
Jørgen Orehøj Erichsen
 
How routing works in angular js
How routing works in angular jsHow routing works in angular js
How routing works in angular js
codeandyou forums
 
Rapi::Blog talk - TPC 2017
Rapi::Blog talk - TPC 2017Rapi::Blog talk - TPC 2017
Rapi::Blog talk - TPC 2017
Henry Van Styn
 
Multi screen HTML5
Multi screen HTML5Multi screen HTML5
Multi screen HTML5
Ron Reiter
 
Jasig Rubyon Rails
Jasig Rubyon RailsJasig Rubyon Rails
Jasig Rubyon Rails
Paul Pajo
 
Single Page Applications Workshop Part II: Single Page Applications using Ang...
Single Page Applications Workshop Part II: Single Page Applications using Ang...Single Page Applications Workshop Part II: Single Page Applications using Ang...
Single Page Applications Workshop Part II: Single Page Applications using Ang...
Jalal Mostafa
 
EVOLVE'14 | Enhance | Gabriel Walt | Sightly Component Development
EVOLVE'14 | Enhance | Gabriel Walt | Sightly Component DevelopmentEVOLVE'14 | Enhance | Gabriel Walt | Sightly Component Development
EVOLVE'14 | Enhance | Gabriel Walt | Sightly Component Development
Evolve The Adobe Digital Marketing Community
 
Advance Android Layout Walkthrough
Advance Android Layout WalkthroughAdvance Android Layout Walkthrough
Advance Android Layout Walkthrough
Somkiat Khitwongwattana
 

What's hot (20)

Atlas Php
Atlas PhpAtlas Php
Atlas Php
 
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
 
Introduction to Ember.js
Introduction to Ember.jsIntroduction to Ember.js
Introduction to Ember.js
 
jQuery and Rails: Best Friends Forever
jQuery and Rails: Best Friends ForeverjQuery and Rails: Best Friends Forever
jQuery and Rails: Best Friends Forever
 
Single Page Web Apps with Backbone.js and Rails
Single Page Web Apps with Backbone.js and RailsSingle Page Web Apps with Backbone.js and Rails
Single Page Web Apps with Backbone.js and Rails
 
[2015/2016] JavaScript
[2015/2016] JavaScript[2015/2016] JavaScript
[2015/2016] JavaScript
 
Intro to BackboneJS + Intermediate Javascript
Intro to BackboneJS + Intermediate JavascriptIntro to BackboneJS + Intermediate Javascript
Intro to BackboneJS + Intermediate Javascript
 
Views
ViewsViews
Views
 
Apex & jQuery Mobile
Apex & jQuery MobileApex & jQuery Mobile
Apex & jQuery Mobile
 
BackboneJS Training - Giving Backbone to your applications
BackboneJS Training - Giving Backbone to your applicationsBackboneJS Training - Giving Backbone to your applications
BackboneJS Training - Giving Backbone to your applications
 
Rails course day 7
Rails course day 7Rails course day 7
Rails course day 7
 
Handlebars & Require JS
Handlebars  & Require JSHandlebars  & Require JS
Handlebars & Require JS
 
Finding unused code in your Rails app
Finding unused code in your Rails appFinding unused code in your Rails app
Finding unused code in your Rails app
 
How routing works in angular js
How routing works in angular jsHow routing works in angular js
How routing works in angular js
 
Rapi::Blog talk - TPC 2017
Rapi::Blog talk - TPC 2017Rapi::Blog talk - TPC 2017
Rapi::Blog talk - TPC 2017
 
Multi screen HTML5
Multi screen HTML5Multi screen HTML5
Multi screen HTML5
 
Jasig Rubyon Rails
Jasig Rubyon RailsJasig Rubyon Rails
Jasig Rubyon Rails
 
Single Page Applications Workshop Part II: Single Page Applications using Ang...
Single Page Applications Workshop Part II: Single Page Applications using Ang...Single Page Applications Workshop Part II: Single Page Applications using Ang...
Single Page Applications Workshop Part II: Single Page Applications using Ang...
 
EVOLVE'14 | Enhance | Gabriel Walt | Sightly Component Development
EVOLVE'14 | Enhance | Gabriel Walt | Sightly Component DevelopmentEVOLVE'14 | Enhance | Gabriel Walt | Sightly Component Development
EVOLVE'14 | Enhance | Gabriel Walt | Sightly Component Development
 
Advance Android Layout Walkthrough
Advance Android Layout WalkthroughAdvance Android Layout Walkthrough
Advance Android Layout Walkthrough
 

Similar to Getting into ember.js

Create an application with ember
Create an application with ember Create an application with ember
Create an application with ember
Chandra Sekar
 
Workshop 17: EmberJS parte II
Workshop 17: EmberJS parte IIWorkshop 17: EmberJS parte II
Workshop 17: EmberJS parte II
Visual Engineering
 
Introducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverIntroducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverSpike Brehm
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introduction
Tomi Juhola
 
Headless Drupal en pratique
Headless Drupal en pratiqueHeadless Drupal en pratique
Headless Drupal en pratique
Simon Morvan
 
Ember vs Backbone
Ember vs BackboneEmber vs Backbone
Ember vs Backbone
Abdriy Mosin
 
Introduction to Ember.js
Introduction to Ember.jsIntroduction to Ember.js
Introduction to Ember.js
Vinoth Kumar
 
Ruby On Rails Siddhesh
Ruby On Rails SiddheshRuby On Rails Siddhesh
Ruby On Rails Siddhesh
Siddhesh Bhobe
 
Pentesting Modern Web Apps: A Primer
Pentesting Modern Web Apps: A PrimerPentesting Modern Web Apps: A Primer
Pentesting Modern Web Apps: A Primer
Brian Hysell
 
Ember.js - A JavaScript framework for creating ambitious web applications
Ember.js - A JavaScript framework for creating ambitious web applications  Ember.js - A JavaScript framework for creating ambitious web applications
Ember.js - A JavaScript framework for creating ambitious web applications
Juliana Lucena
 
Nodejs.meetup
Nodejs.meetupNodejs.meetup
Nodejs.meetup
Vivian S. Zhang
 
Ams adapters
Ams adaptersAms adapters
Ams adapters
Bruno Alló Bacarini
 
Angular 2 Essential Training
Angular 2 Essential Training Angular 2 Essential Training
Angular 2 Essential Training
Patrick Schroeder
 
MIKE Stack Introduction - MongoDB, io.js, KendoUI, and Express
MIKE Stack Introduction - MongoDB, io.js, KendoUI, and ExpressMIKE Stack Introduction - MongoDB, io.js, KendoUI, and Express
MIKE Stack Introduction - MongoDB, io.js, KendoUI, and Express
Charlie Key
 
Angular js
Angular jsAngular js
Angular js
prasaddammalapati
 
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Jamie Matthews
 
CCCDjango2010.pdf
CCCDjango2010.pdfCCCDjango2010.pdf
CCCDjango2010.pdf
jayarao21
 
Dojo - from web page to web apps
Dojo - from web page to web appsDojo - from web page to web apps
Dojo - from web page to web apps
yoavrubin
 
GHC
GHCGHC
GHC
AidIQ
 
Architecting single-page front-end apps
Architecting single-page front-end appsArchitecting single-page front-end apps
Architecting single-page front-end appsZohar Arad
 

Similar to Getting into ember.js (20)

Create an application with ember
Create an application with ember Create an application with ember
Create an application with ember
 
Workshop 17: EmberJS parte II
Workshop 17: EmberJS parte IIWorkshop 17: EmberJS parte II
Workshop 17: EmberJS parte II
 
Introducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverIntroducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and server
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introduction
 
Headless Drupal en pratique
Headless Drupal en pratiqueHeadless Drupal en pratique
Headless Drupal en pratique
 
Ember vs Backbone
Ember vs BackboneEmber vs Backbone
Ember vs Backbone
 
Introduction to Ember.js
Introduction to Ember.jsIntroduction to Ember.js
Introduction to Ember.js
 
Ruby On Rails Siddhesh
Ruby On Rails SiddheshRuby On Rails Siddhesh
Ruby On Rails Siddhesh
 
Pentesting Modern Web Apps: A Primer
Pentesting Modern Web Apps: A PrimerPentesting Modern Web Apps: A Primer
Pentesting Modern Web Apps: A Primer
 
Ember.js - A JavaScript framework for creating ambitious web applications
Ember.js - A JavaScript framework for creating ambitious web applications  Ember.js - A JavaScript framework for creating ambitious web applications
Ember.js - A JavaScript framework for creating ambitious web applications
 
Nodejs.meetup
Nodejs.meetupNodejs.meetup
Nodejs.meetup
 
Ams adapters
Ams adaptersAms adapters
Ams adapters
 
Angular 2 Essential Training
Angular 2 Essential Training Angular 2 Essential Training
Angular 2 Essential Training
 
MIKE Stack Introduction - MongoDB, io.js, KendoUI, and Express
MIKE Stack Introduction - MongoDB, io.js, KendoUI, and ExpressMIKE Stack Introduction - MongoDB, io.js, KendoUI, and Express
MIKE Stack Introduction - MongoDB, io.js, KendoUI, and Express
 
Angular js
Angular jsAngular js
Angular js
 
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
 
CCCDjango2010.pdf
CCCDjango2010.pdfCCCDjango2010.pdf
CCCDjango2010.pdf
 
Dojo - from web page to web apps
Dojo - from web page to web appsDojo - from web page to web apps
Dojo - from web page to web apps
 
GHC
GHCGHC
GHC
 
Architecting single-page front-end apps
Architecting single-page front-end appsArchitecting single-page front-end apps
Architecting single-page front-end apps
 

More from reybango

NationJS: Node Noob to not so Noob
NationJS: Node Noob to not so Noob NationJS: Node Noob to not so Noob
NationJS: Node Noob to not so Noob
reybango
 
From Node.js noob to not so noob
From Node.js noob to not so noobFrom Node.js noob to not so noob
From Node.js noob to not so noob
reybango
 
How to Test IE & Microsoft Edge on OS X & Linux - SFHTML
How to Test IE & Microsoft Edge on OS X & Linux - SFHTMLHow to Test IE & Microsoft Edge on OS X & Linux - SFHTML
How to Test IE & Microsoft Edge on OS X & Linux - SFHTML
reybango
 
Woah, You Can Test IE & Microsoft Edge on a Mac?
Woah, You Can Test IE & Microsoft Edge on a Mac?Woah, You Can Test IE & Microsoft Edge on a Mac?
Woah, You Can Test IE & Microsoft Edge on a Mac?
reybango
 
A day in the life of a Developer Advocate
A day in the life of a Developer AdvocateA day in the life of a Developer Advocate
A day in the life of a Developer Advocate
reybango
 
Filling the HTML5 Gaps with Polyfills and Shims
Filling the HTML5 Gaps with Polyfills and ShimsFilling the HTML5 Gaps with Polyfills and Shims
Filling the HTML5 Gaps with Polyfills and Shims
reybango
 
HTML5 Overview
HTML5 OverviewHTML5 Overview
HTML5 Overview
reybango
 
MAOW Berlin '09 Keynote
MAOW Berlin '09 KeynoteMAOW Berlin '09 Keynote
MAOW Berlin '09 Keynote
reybango
 
AMO Barcamp Miami
AMO Barcamp MiamiAMO Barcamp Miami
AMO Barcamp Miamireybango
 

More from reybango (9)

NationJS: Node Noob to not so Noob
NationJS: Node Noob to not so Noob NationJS: Node Noob to not so Noob
NationJS: Node Noob to not so Noob
 
From Node.js noob to not so noob
From Node.js noob to not so noobFrom Node.js noob to not so noob
From Node.js noob to not so noob
 
How to Test IE & Microsoft Edge on OS X & Linux - SFHTML
How to Test IE & Microsoft Edge on OS X & Linux - SFHTMLHow to Test IE & Microsoft Edge on OS X & Linux - SFHTML
How to Test IE & Microsoft Edge on OS X & Linux - SFHTML
 
Woah, You Can Test IE & Microsoft Edge on a Mac?
Woah, You Can Test IE & Microsoft Edge on a Mac?Woah, You Can Test IE & Microsoft Edge on a Mac?
Woah, You Can Test IE & Microsoft Edge on a Mac?
 
A day in the life of a Developer Advocate
A day in the life of a Developer AdvocateA day in the life of a Developer Advocate
A day in the life of a Developer Advocate
 
Filling the HTML5 Gaps with Polyfills and Shims
Filling the HTML5 Gaps with Polyfills and ShimsFilling the HTML5 Gaps with Polyfills and Shims
Filling the HTML5 Gaps with Polyfills and Shims
 
HTML5 Overview
HTML5 OverviewHTML5 Overview
HTML5 Overview
 
MAOW Berlin '09 Keynote
MAOW Berlin '09 KeynoteMAOW Berlin '09 Keynote
MAOW Berlin '09 Keynote
 
AMO Barcamp Miami
AMO Barcamp MiamiAMO Barcamp Miami
AMO Barcamp Miami
 

Recently uploaded

Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Florence Consulting
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
ufdana
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
GTProductions1
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
JungkooksNonexistent
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
Bài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docxBài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docx
nhiyenphan2005
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
laozhuseo02
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
laozhuseo02
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
JeyaPerumal1
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
nirahealhty
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
Javier Lasa
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 
Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027
harveenkaur52
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
CIOWomenMagazine
 

Recently uploaded (20)

Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
Bài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docxBài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docx
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 
Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
 

Getting into ember.js

Editor's Notes

  1. Aims to simplify the process of building a manageable codebases for a single-page apps
  2. The team has purposely taken steps to abstract a lot of the complexities inherent in designing and building Model/View/Controller based applications using years of expertise and knowledge gained from building large-scale apps.&lt;reference list above&gt;Taken best practices and patterns and applied it to Ember to make it easier to manage and scale out complex single-page applications.
  3. Its naming conventions which tie features togetherDictates to some extent a specific way of developing apps that maximizes productivity by lessening complex codeChoice of complementary frameworks like jQuery &amp; handlebars
  4. Ember went through a long period of updates pre-1.0 with a lot of changes that broke the API.The API is feature-frozen at this point.
  5. Lastly, Ember does a lot of magic for you. There are times when you’ll look at the code and say “Huh? How’d it do that?” I’ve been there and I’ll do my best to distill things, but I’m not going to dive into the bowels of Ember’s framework code. Instead, I’ll discuss how you can leverage its tools and API to build your app.
  6. What I’d like to do is help get you up to speed with Ember.js by introducing you to the concepts of the framework. We’ll start off with the usual intro and then gradually ramp up to building a full application.
  7. At it’s most basic level, an Ember app only needs this one line to technically be considered an “app”.This code sets up an instance of the Ember Application object along with a default application template, event listeners and application router. Take a second and try to think of the code you would normally have to write to create a global namespace, a client-side template, bind event handlers for global user interaction and include history &amp; state management in your code. Yes, that one line does all of that. Let’s be clear though. I’m not saying it’s doing all of your work for you but it is creating the foundation you’ll build upon, via one method call.
  8. One of the ways that Ember.js helps to minimize the amount of code needed and handle things for you behind the scenes is through naming conventions. The way that you define and name your routes (and resources) impacts the naming of your controllers, models, views and templates
  9. One of the ways that Ember.js helps to minimize the amount of code needed and handle things for you behind the scenes is through naming conventions. The way that you define and name your routes (and resources) impacts the naming of your controllers, views and templates
  10. Routing is arguably the most difficult concept to understand in Ember so I’ll do my best to break it down to manageable steps. As a user navigates your application, there needs to be a method of managing the state of the various parts the user visits. That’s where the application’s router and location-specific routes come in. The Ember router object is what manages this through the use of routes that identify the resources needed for specification locations. I like to think of the router as a traffic cop that’s directing traffic.
  11. Routes specify parts of the application and the URLs associated to them. The URL is the key identifier that Ember uses to understand which application state needs to be presented to the user. You do this by creating a route for specific locations within your application using the resource() method. In this example, we’ve created a route for the “about” section of our app. When a user goes to the about URL, the router directs the request to the route where resources can then be loaded accordingly.
  12. The behaviors of a route (e.g.: requesting data from a model) are managed via instances of the Ember route object and are fired when a user navigates to a specific URL
  13. Route objects do the heavy lifting for the routes. This is where you’ll generally add all of the behavioral code needed when a user goes to a specific URL.Naming conventions are important to make tying routes and route objects together so in this case, I would expect to have a route named Gallery which is directly tied to the GalleryRoute class above. When the user visits the gallery URL, it will know internally that it needs to reference the GalleryRoute class and load appropriate resources.
  14. Templates are a key part of defining your user interface. As I mentioned previously, Handlebars is the client-side library used in Ember and the expressions provided by the library are used extensively when creating the UI for your application. Here’s a simple example. When Ember parses this template, it replaces the placeholders with the actual data.
  15. Handlebars offers important an extensive variety of directives to do things like conditional expressions or looping over a data set.
  16. Handlebars offers important an extensive variety of directives to do things like conditional expressions or looping over a data set.
  17. Handlebars offers important an extensive variety of directives to do things like conditional expressions or looping over a data set.
  18. It also allows you to bind attributes to HTML elements or create links that are bound to routes.
  19. It also allows you to bind attributes to HTML elements or create links that are bound to routes.
  20. It also allows you to bind attributes to HTML elements or create links that are bound to routes.
  21. Models are an object representation of the data your application will use. It could be a simple array or data dynamically retrieved from a RESTful JSON API, via an Ajax request.There are two ways of working with data in Ember: the Ember Data library or subclassingEmber.Object. Ember Data is the future of data management in Ember but it’s not ready for production so I’m going to focus on building object instances that represent your data.
  22. For example, let’s say we have this VERY large bit of JSON data from Reddit. If you’ve ever worked with JSON, this hierarchical, key/pair style response should be familiar to you.
  23. In Ember, I would first create a subclass of Ember.Object using the extend method.Next, I would use Ember’s reopenClass method to extend the objects API and add a method to make the Ajax call to reddit, loop through the response, load each bit of child data into an array and return it. Easy Peazy.
  24. Once my model has been defined, I want to hook it up to my route object via a keyword called model. It’s also known as the model hook and gives the route object and its controller access to the attributes of the model.
  25. Controllers are typically used to represent model data and attributes. They act like a proxy, giving you access to the model’s attributes and allowing templates to access them to dynamically render the display. This is why a template will always be connected to a controller.The main thing to remember is that, while a model retrieves data, a controller is what you’ll use to programmatically expose that data to different parts of your application. While it may seem that models and controllers are tightly coupled, in fact, models, themselves, have no knowledge of the controllers that will use them later on.You can also store other application properties that need to persist but don’t need to be saved to a server.
  26. In Ember.js, templates know about controllers and controllers know about models, but the reverse is not true. A model knows nothing about which controllers are interfacing with it.This also means that as far as a template is concerned, all of its properties come from its controller, and it doesn&apos;t need to know about the model directly.
  27. You can explicitly define a controller with the route object using the setupController method. In this case, the controller is setting up static data via property called content.
  28. You can also create a controller bysubclassingEmber.Controller. Again, this is an example of where naming conventions are important. Because of its name, Ember would assume that this controller belongs to the gallery route.
  29. Now that we’ve gone over the core concepts of Ember, let’s work towards actually building something. I realize that was a lot to take in but don’t stress. We’ll be taking baby steps in the next chapters and don’t forget that you have a number of online resources available to you if you do get stuck.
  30. What I’d like to do is help get you up to speed with Ember.js by introducing you to the concepts of the framework. We’ll start off with the usual intro and then gradually ramp up to building a full application.
  31. What I’d like to do is help get you up to speed with Ember.js by introducing you to the concepts of the framework. We’ll start off with the usual intro and then gradually ramp up to building a full application.