SlideShare a Scribd company logo
1 of 16
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

What's hot

What's hot (20)

Angularjs
AngularjsAngularjs
Angularjs
 
Angular js PPT
Angular js PPTAngular js PPT
Angular js PPT
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
 
Angular js
Angular jsAngular js
Angular js
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework
 
AngularJS: an introduction
AngularJS: an introductionAngularJS: an introduction
AngularJS: an introduction
 
[@NaukriEngineering] Flux Architecture
[@NaukriEngineering] Flux Architecture[@NaukriEngineering] Flux Architecture
[@NaukriEngineering] Flux Architecture
 
AngularJS
AngularJSAngularJS
AngularJS
 
Mvc3 crash
Mvc3 crashMvc3 crash
Mvc3 crash
 
Angular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseAngular Js Get Started - Complete Course
Angular Js Get Started - Complete Course
 
Angular js
Angular jsAngular js
Angular js
 
Dot net interview questions and asnwers
Dot net interview questions and asnwersDot net interview questions and asnwers
Dot net interview questions and asnwers
 
AngularJS application architecture
AngularJS application architectureAngularJS application architecture
AngularJS application architecture
 
ASP .NET MVC
ASP .NET MVC ASP .NET MVC
ASP .NET MVC
 
The Chaos Tools Suite
The Chaos Tools SuiteThe Chaos Tools Suite
The Chaos Tools Suite
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Active Admin
Active AdminActive Admin
Active Admin
 
Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSAdvanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JS
 
Angular js
Angular jsAngular js
Angular js
 

Viewers also liked

Orginal Training Report
Orginal Training ReportOrginal Training Report
Orginal Training ReportHafez Fayad
 
2016 Roof Pricing Guide
2016 Roof Pricing Guide2016 Roof Pricing Guide
2016 Roof Pricing GuideAustin Jewell
 
แบบเสนอโครงร่างโครงงานคอมพิวเตอร์606
แบบเสนอโครงร่างโครงงานคอมพิวเตอร์606แบบเสนอโครงร่างโครงงานคอมพิวเตอร์606
แบบเสนอโครงร่างโครงงานคอมพิวเตอร์606Angkana Potha
 
67+68 M5C2 Lezione 2. dalla costituzione ai giorni nostri
67+68 M5C2 Lezione 2. dalla costituzione ai giorni nostri 67+68 M5C2 Lezione 2. dalla costituzione ai giorni nostri
67+68 M5C2 Lezione 2. dalla costituzione ai giorni nostri raffaelebruno1
 
Curso de informatica
Curso de informaticaCurso de informatica
Curso de informaticamarcelaura
 
Koswer Piramid Makanan
Koswer Piramid MakananKoswer Piramid Makanan
Koswer Piramid Makanansri_indah2022
 
Social media 3 the new world
Social media 3   the new worldSocial media 3   the new world
Social media 3 the new worldDonald Young
 
Social media and school communication
Social media and school communicationSocial media and school communication
Social media and school communicationDoris Herrmann
 
Berlin vg deck and exercise
Berlin vg deck and exerciseBerlin vg deck and exercise
Berlin vg deck and exerciseTom Wenzani
 
【模擬投票×マニフェストスイッチ】概要説明資料
【模擬投票×マニフェストスイッチ】概要説明資料【模擬投票×マニフェストスイッチ】概要説明資料
【模擬投票×マニフェストスイッチ】概要説明資料Tetsuya Sato
 
2012 betty & hkc
2012 betty & hkc2012 betty & hkc
2012 betty & hkcforumhunter
 

Viewers also liked (19)

Orginal Training Report
Orginal Training ReportOrginal Training Report
Orginal Training Report
 
Ghazawi-CV updat - April 2016
Ghazawi-CV updat - April 2016Ghazawi-CV updat - April 2016
Ghazawi-CV updat - April 2016
 
2016 Roof Pricing Guide
2016 Roof Pricing Guide2016 Roof Pricing Guide
2016 Roof Pricing Guide
 
แบบเสนอโครงร่างโครงงานคอมพิวเตอร์606
แบบเสนอโครงร่างโครงงานคอมพิวเตอร์606แบบเสนอโครงร่างโครงงานคอมพิวเตอร์606
แบบเสนอโครงร่างโครงงานคอมพิวเตอร์606
 
67+68 M5C2 Lezione 2. dalla costituzione ai giorni nostri
67+68 M5C2 Lezione 2. dalla costituzione ai giorni nostri 67+68 M5C2 Lezione 2. dalla costituzione ai giorni nostri
67+68 M5C2 Lezione 2. dalla costituzione ai giorni nostri
 
Curso de informatica
Curso de informaticaCurso de informatica
Curso de informatica
 
Koswer Piramid Makanan
Koswer Piramid MakananKoswer Piramid Makanan
Koswer Piramid Makanan
 
Social media 3 the new world
Social media 3   the new worldSocial media 3   the new world
Social media 3 the new world
 
Social media and school communication
Social media and school communicationSocial media and school communication
Social media and school communication
 
Berlin vg deck and exercise
Berlin vg deck and exerciseBerlin vg deck and exercise
Berlin vg deck and exercise
 
Los mares del mundo
Los mares del mundoLos mares del mundo
Los mares del mundo
 
UOY
UOYUOY
UOY
 
Eines
EinesEines
Eines
 
Ivete
IveteIvete
Ivete
 
【模擬投票×マニフェストスイッチ】概要説明資料
【模擬投票×マニフェストスイッチ】概要説明資料【模擬投票×マニフェストスイッチ】概要説明資料
【模擬投票×マニフェストスイッチ】概要説明資料
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
2012 betty & hkc
2012 betty & hkc2012 betty & hkc
2012 betty & hkc
 
4t
4t4t
4t
 
Green india
Green indiaGreen india
Green india
 

Similar to Introduction to Ember.js

Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to AngularjsGaurav Agrawal
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development GuideNitin Giri
 
Create an application with ember
Create an application with ember Create an application with ember
Create an application with ember Chandra Sekar
 
Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JSBipin
 
introduction to Angularjs basics
introduction to Angularjs basicsintroduction to Angularjs basics
introduction to Angularjs basicsRavindra K
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSShyjal Raazi
 
The Basics Angular JS
The Basics Angular JS The Basics Angular JS
The Basics Angular JS OrisysIndia
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS BasicsRavi Mone
 
Learning AngularJS - Complete coverage of AngularJS features and concepts
Learning AngularJS  - Complete coverage of AngularJS features and conceptsLearning AngularJS  - Complete coverage of AngularJS features and concepts
Learning AngularJS - Complete coverage of AngularJS features and conceptsSuresh Patidar
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedAngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedStéphane Bégaudeau
 
Foster - Getting started with Angular
Foster - Getting started with AngularFoster - Getting started with Angular
Foster - Getting started with AngularMukundSonaiya1
 
Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01Arunangsu Sahu
 
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
 

Similar to Introduction to Ember.js (20)

Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
 
Introduction to Angular Js
Introduction to Angular JsIntroduction to Angular Js
Introduction to Angular Js
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development Guide
 
Create an application with ember
Create an application with ember Create an application with ember
Create an application with ember
 
Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JS
 
introduction to Angularjs basics
introduction to Angularjs basicsintroduction to Angularjs basics
introduction to Angularjs basics
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
The Basics Angular JS
The Basics Angular JS The Basics Angular JS
The Basics Angular JS
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
 
Learning AngularJS - Complete coverage of AngularJS features and concepts
Learning AngularJS  - Complete coverage of AngularJS features and conceptsLearning AngularJS  - Complete coverage of AngularJS features and concepts
Learning AngularJS - Complete coverage of AngularJS features and concepts
 
AngularJS
AngularJSAngularJS
AngularJS
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedAngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get started
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
 
Angular Js Basics
Angular Js BasicsAngular Js Basics
Angular Js Basics
 
Foster - Getting started with Angular
Foster - Getting started with AngularFoster - Getting started with Angular
Foster - Getting started with Angular
 
AngularJs
AngularJsAngularJs
AngularJs
 
Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01
 
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
 
Angular js for Beginnners
Angular js for BeginnnersAngular js for Beginnners
Angular js for Beginnners
 

Recently uploaded

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Recently uploaded (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 

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 });