SlideShare a Scribd company logo
Ember.js - introduction
‘A framework for creating ambitious web applications’
Ember users in Production
For more users http://emberjs.com/ember-users/
Ember.js: What
• Frontend JavaScript web application framework
• Based on model-view-controller (MVC)
• Used to write complex front-end heavy web apps
• Designed for Single Page Applications
• Gives you an organized structure, conventions and built-in ways
• Like Angular, backbone & knockout, now ember to help developers
build great front end application
• Key Developers: Yehuda Katz, Tom Dale
Ember : why
• Logical code organization
• Convention similar to Rails background
• Easy persistence
• Saving or deleting object is easier
• Auto-updating templates(Two way binding)
• {{ myProperty }}
• Helpful Object API’s
• Build-in methods
• Ember has Array object with methods like contains, filterBy, sortBy, etc
• Debugging : The Ember inspector for Firefox and Chrome
History
MVC
Ember-cli
• Ember CLI aims to be one such Ember.js command line utility that we can use to build,
develop and ship ambitious SPA
• Includes fast asset pipeline broccoli
• Draws heavy inspiration from Rails asset pipeline
• Runs on node.js and independent of backend platform
• Figures out which files have changed and only rebuilds those that were modified
• Assets supported by Broccoli like Handlebars, Emblem, LESS, Sass, Compass, Stylus, CoffeeScript,
EmberScript, Minified JS and CSS
• Every Ember-cli project will contain a file called Brocfile.js present at the root of the
project. This is the definition file and contains build specific instructions of the project.
(In latest version of Ember-cli, file renamed to ember-cli-build.js)
• Ember CLI uses bower as the default tool to manage the dependencies of our
application and lets us to easily manage and keep frontend dependencies up-to-date
• Ember CLI uses npm(Node Package Manager) to manage its internal dependencies.
• Ember CLI comes with content security add on, this guards from XSS attacks
Pre-requisites(To set up application)
• Node(npm)
• from https://nodejs.org
• Ember-cli(ember-cli)
• via npm install –g ember-cli
• Bower(bower)
• via npm install –g bower
• PhantomJS(phantomjs)
• via npm install –g phantomjs
App Folder Structure
• Creating a new application
• Cmd: ember new my-first-ember-app
• Folder Structure
App Folder Details• app/components
• All components of our application like reusable components used for view or models
• app/controllers
• Contains the controller modules of our application
• app/helpers
• Contain all the handlebars helpers for view
• app/models
• Contain all the ember-data model modules
• app/routes
• Contains all application routes
• app/styles
• Contains stylesheets
• app/templates
• Contains all the handlebars/HTMLBars templates
• app/views
• Contains all our application views
• app/router.js
• Contains our route configuration
• Routes defined here are resolved from the modules defined in app/routes/
App Folder Details cont..
• app/app.js
• Main entry point of our application and contains configuration applies to our
Ember.js application
• Have default generated code which exports our Ember.js application inherits
from Ember.Application class
• app/index.js
• main file for the Single Page web Application.
• has the structure of our application, includes js and css files
• Includes certain hooks like {{content-for 'head'}}, {{content-for 'head-footer'}},
{{content-for 'body'}}, {{content-for 'body-footer'}}
Supporting Files and Folder
• bower_components
• Contains all dependencies which Ember CLI installs via bower
• bower components are listed in bower.json configuration file
• config/environment.js
• Placeholder of our application configuration
• Supports different configurations for different configuration for our application, by default it has created configurations for
development, test and production environments
• node_modules
• Contains the node dependencies used by Ember CLI
• public
• Contains assets that should be copied as they are to the root of the packaged application
• vendor
• This folder should contains libraries which cannot be installed using bower or npm
• The libraries in vendor should then be imported into the broccoli asset pipeline by adding in Brocfile.js/ember-cli-build.js
• test
• Contains helpers and resolver to run unit and integration tests using the Ember testing module
• Cmd: ember test or http://localhost:4200/test in browser
• Ember Cli uses Qunit as its testing library
Supporting Files and Folder cont…
• brocfile.js/ember-cli-build.js:
• Build instructions for broccoli asset pipeline
• Additional libraries included if we import the files
• Eg: app.import(‘bower_components/bootstrap/dist/css/bootstrap.css’);
• bower.json
• Configuration file for bower and contains the dependencies of our application
that need to installed via bower
• package.json
• Configuration file for npm and contains node.js dependencies required by our
application
Running the application
• Cmd : ember server
• By default runs on 4200 port
• For different port
• Cmd: ember server –port 4300
Or
Add configuration in .ember-cli by adding {“port”: 4300}
• Ember.js strongly relies on naming conventions. So, if you want the
page /foo in your app, you will have the following:
• a foo template,
• a FooRoute,
• a FooController,
• and a FooView.
Components
• Router/Route
• Controller
• Model
• View/Component
• Templates
Concepts Map
The router
• Routes are the root of all other concepts in Ember
• The router drives the rest of the gears in ember
router.js
eg:- this.route(‘users’);
Route class
• Sets up the model (data) and the controller
• Will take actions/events that bubble up it from the controller
Models
• Defines the data you need
• Uses attributes for defining the data type: number, boolean, string,
etc.
• Also uses relational mapping for defining relationship between
models: hasMany, belongsTo, etc.
Controller
• Takes the model from the route
• Model can be an object or an array/collection
• Is responsible for:
• Mutating the model
• User interaction
• Page logic
• Can define observable and computed properties
Template(Handlebars markup)
• Uses Handlebars as the rendering language
• Mostly plain old HTML
• Hooks to controller - provides the logic
• Hooks to the model - provides the data
View
• A class for when doing DOM manipulation is necessary
• If you need to do DOM manipulation, you should ask yourself what
you may be doing wrong
• Should not be used often
Components
• Reusable parts
• Your own HTML tags/elements
• Any part of your application that repeats is a candidate for a
component
• Ember comes with a bunch of these:
• Input box helpers, dropdown menu, links, etc.
Adapter
If caching happens
Architecture overview
For a new Record
Note on coupling
- In Ember.js, templates get their properties from
controllers, which decorate a model.
- templates know about controllers and controllers know
about models, but the reverse is not true. A model
knows nothing about which (if any) controllers are
decorating it, and a controller does not know which
templates are presenting its properties.
- For example, if the user navigates
from /posts/1 to /posts/2, the PostController's model
will change from store.findRecord('post',
1) to store.findRecord('post', 2). The template will
update its representations of any properties on the
model, as well as any computed properties on the
controller that depend on the model.
Example for routes and its components
Few Codes
• To define a new Ember class, call the extend() method
on Ember.Object
• Eg:-
• Person = Ember.Object.extend({ say(thing) { var name = this.get('name'); alert(name + "
says: " + thing); } });
• RETRIEVING A SINGLE RECORD
• var post = this.store.findRecord('post', 1); // => GET /posts/1
• var post = this.store.peekRecord('post', 1); // => no network request
• RETRIEVING MULTIPLE RECORDS
• var posts = this.store.findAll('post'); // => GET /posts
• var posts = this.store.peekAll('post'); // => no network request
• QUERYING FOR MULTIPLE RECORDS
• var peters = this.store.query('person', { name: 'Peter' }); // => GET to
/persons?name=Peter
FewNotes
• EMBER.OBJECT
• Ember implements its own object system. The base object is Ember.Object. All of the other objects in Ember
extend Ember.Object.
• user = Ember.Object.create()
• user = Ember.Object.create({ firstName: hari', lastName: c' })
• Getter
• user.firstName or user.get(‘firstName’)
• CLASSES
• var Person = Ember.Object.extend({ say: function (message) { alert(message); } });
• var bob = Person.create(); bob.say('hello world');
• // alerts "hello world"
• Ember-Data
• Ember-Data is a library that lets you retrieve records from a server, hold them in a Store, update them in the
browser and, finally, save them back to the server. The Store can be configured with various adapters
• RESTAdapter interacts with a JSON API
• LSAdapter persists your data in the browser’s local storage
Resources
• http://guides.emberjs.com/
• http://emberwatch.com/tutorials.html
• https://en.wikipedia.org/wiki/Ember.js
• Ebook: Ember.js Web development with Ember CLI – Suchit Puri
• Ebook: Ember-cli-101: An Ember.js book with ember-cli
• Lynda.com, codeschool
• Youtube tutorials
• Dockyard.com ember tutorial

More Related Content

What's hot

Express js
Express jsExpress js
Express js
Manav Prasad
 
Basics of VueJS
Basics of VueJSBasics of VueJS
Basics of VueJS
Squash Apps Pvt Ltd
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
ivpol
 
Introduction to VueJS & Vuex
Introduction to VueJS & VuexIntroduction to VueJS & Vuex
Introduction to VueJS & Vuex
Bernd Alter
 
Vue js for beginner
Vue js for beginner Vue js for beginner
Vue js for beginner
Chandrasekar G
 
An Introduction to Vuejs
An Introduction to VuejsAn Introduction to Vuejs
An Introduction to Vuejs
Paddy Lock
 
Building beautiful apps with Google flutter
Building beautiful apps with Google flutterBuilding beautiful apps with Google flutter
Building beautiful apps with Google flutter
Ahmed Abu Eldahab
 
Introduction to Django REST Framework, an easy way to build REST framework in...
Introduction to Django REST Framework, an easy way to build REST framework in...Introduction to Django REST Framework, an easy way to build REST framework in...
Introduction to Django REST Framework, an easy way to build REST framework in...
Zhe Li
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Vikash Singh
 
Intro to vue.js
Intro to vue.jsIntro to vue.js
Intro to vue.js
TechMagic
 
Introduction to back-end
Introduction to back-endIntroduction to back-end
Introduction to back-end
Mosaab Ehab
 
Introduction to MERN Stack
Introduction to MERN StackIntroduction to MERN Stack
Introduction to MERN Stack
Surya937648
 
ASP .net MVC
ASP .net MVCASP .net MVC
ASP .net MVC
Divya Sharma
 
Full stack web development
Full stack web developmentFull stack web development
Full stack web development
Crampete
 
Laravel presentation
Laravel presentationLaravel presentation
Laravel presentation
Toufiq Mahmud
 
Build RESTful API Using Express JS
Build RESTful API Using Express JSBuild RESTful API Using Express JS
Build RESTful API Using Express JS
Cakra Danu Sedayu
 
Spring Boot Actuator
Spring Boot ActuatorSpring Boot Actuator
Spring Boot Actuator
Rowell Belen
 
Java Web Programming [1/9] : Introduction to Web Application
Java Web Programming [1/9] : Introduction to Web ApplicationJava Web Programming [1/9] : Introduction to Web Application
Java Web Programming [1/9] : Introduction to Web Application
IMC Institute
 
How To be a Backend developer
How To be a Backend developer    How To be a Backend developer
How To be a Backend developer
Ramy Hakam
 
Django Seminar
Django SeminarDjango Seminar
Django Seminar
Yokesh Rana
 

What's hot (20)

Express js
Express jsExpress js
Express js
 
Basics of VueJS
Basics of VueJSBasics of VueJS
Basics of VueJS
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Introduction to VueJS & Vuex
Introduction to VueJS & VuexIntroduction to VueJS & Vuex
Introduction to VueJS & Vuex
 
Vue js for beginner
Vue js for beginner Vue js for beginner
Vue js for beginner
 
An Introduction to Vuejs
An Introduction to VuejsAn Introduction to Vuejs
An Introduction to Vuejs
 
Building beautiful apps with Google flutter
Building beautiful apps with Google flutterBuilding beautiful apps with Google flutter
Building beautiful apps with Google flutter
 
Introduction to Django REST Framework, an easy way to build REST framework in...
Introduction to Django REST Framework, an easy way to build REST framework in...Introduction to Django REST Framework, an easy way to build REST framework in...
Introduction to Django REST Framework, an easy way to build REST framework in...
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Intro to vue.js
Intro to vue.jsIntro to vue.js
Intro to vue.js
 
Introduction to back-end
Introduction to back-endIntroduction to back-end
Introduction to back-end
 
Introduction to MERN Stack
Introduction to MERN StackIntroduction to MERN Stack
Introduction to MERN Stack
 
ASP .net MVC
ASP .net MVCASP .net MVC
ASP .net MVC
 
Full stack web development
Full stack web developmentFull stack web development
Full stack web development
 
Laravel presentation
Laravel presentationLaravel presentation
Laravel presentation
 
Build RESTful API Using Express JS
Build RESTful API Using Express JSBuild RESTful API Using Express JS
Build RESTful API Using Express JS
 
Spring Boot Actuator
Spring Boot ActuatorSpring Boot Actuator
Spring Boot Actuator
 
Java Web Programming [1/9] : Introduction to Web Application
Java Web Programming [1/9] : Introduction to Web ApplicationJava Web Programming [1/9] : Introduction to Web Application
Java Web Programming [1/9] : Introduction to Web Application
 
How To be a Backend developer
How To be a Backend developer    How To be a Backend developer
How To be a Backend developer
 
Django Seminar
Django SeminarDjango Seminar
Django Seminar
 

Viewers also liked

Intro to Ember.js
Intro to Ember.jsIntro to Ember.js
Intro to Ember.js
Jay Phelps
 
Intro to Ember.JS 2016
Intro to Ember.JS 2016Intro to Ember.JS 2016
Intro to Ember.JS 2016
Sandino Núñez
 
An introduction to Ember.js
An introduction to Ember.jsAn introduction to Ember.js
An introduction to Ember.js
codeofficer
 
Ember Reusable Components and Widgets
Ember Reusable Components and WidgetsEmber Reusable Components and Widgets
Ember Reusable Components and Widgets
Sergey Bolshchikov
 
Brief Introduction to Ember
Brief Introduction to EmberBrief Introduction to Ember
Brief Introduction to Ember
Vinay B
 
The road to Ember.js 2.0
The road to Ember.js 2.0The road to Ember.js 2.0
The road to Ember.js 2.0
Codemotion
 
Ember Data Introduction and Basic Concepts
Ember Data Introduction and Basic ConceptsEmber Data Introduction and Basic Concepts
Ember Data Introduction and Basic Concepts
Adam Kloboučník
 
Ember Data
Ember DataEmber Data
Ember Data
Oleg Yaroshevych
 
AfriGadget @ Webmontag Frankfurt, June 6, 2011
AfriGadget @ Webmontag Frankfurt, June 6, 2011AfriGadget @ Webmontag Frankfurt, June 6, 2011
AfriGadget @ Webmontag Frankfurt, June 6, 2011
Juergen Eichholz
 
The Tale of 2 CLIs - Ember-cli and Angular-cli
The Tale of 2 CLIs - Ember-cli and Angular-cliThe Tale of 2 CLIs - Ember-cli and Angular-cli
The Tale of 2 CLIs - Ember-cli and Angular-cli
Tracy Lee
 

Viewers also liked (11)

Intro to Ember.js
Intro to Ember.jsIntro to Ember.js
Intro to Ember.js
 
Intro to Ember.JS 2016
Intro to Ember.JS 2016Intro to Ember.JS 2016
Intro to Ember.JS 2016
 
An introduction to Ember.js
An introduction to Ember.jsAn introduction to Ember.js
An introduction to Ember.js
 
Ember Reusable Components and Widgets
Ember Reusable Components and WidgetsEmber Reusable Components and Widgets
Ember Reusable Components and Widgets
 
Agile Point
Agile PointAgile Point
Agile Point
 
Brief Introduction to Ember
Brief Introduction to EmberBrief Introduction to Ember
Brief Introduction to Ember
 
The road to Ember.js 2.0
The road to Ember.js 2.0The road to Ember.js 2.0
The road to Ember.js 2.0
 
Ember Data Introduction and Basic Concepts
Ember Data Introduction and Basic ConceptsEmber Data Introduction and Basic Concepts
Ember Data Introduction and Basic Concepts
 
Ember Data
Ember DataEmber Data
Ember Data
 
AfriGadget @ Webmontag Frankfurt, June 6, 2011
AfriGadget @ Webmontag Frankfurt, June 6, 2011AfriGadget @ Webmontag Frankfurt, June 6, 2011
AfriGadget @ Webmontag Frankfurt, June 6, 2011
 
The Tale of 2 CLIs - Ember-cli and Angular-cli
The Tale of 2 CLIs - Ember-cli and Angular-cliThe Tale of 2 CLIs - Ember-cli and Angular-cli
The Tale of 2 CLIs - Ember-cli and Angular-cli
 

Similar to Ember - introduction

A Beginner's Guide to Ember
A Beginner's Guide to EmberA Beginner's Guide to Ember
A Beginner's Guide to Ember
Richard Martin
 
Ember.js: Jump Start
Ember.js: Jump Start Ember.js: Jump Start
Ember.js: Jump Start
Viacheslav Bukach
 
Introduction to Monsoon PHP framework
Introduction to Monsoon PHP frameworkIntroduction to Monsoon PHP framework
Introduction to Monsoon PHP framework
Krishna Srikanth Manda
 
Custom Tile Generation in PCF
Custom Tile Generation in PCFCustom Tile Generation in PCF
Custom Tile Generation in PCF
VMware Tanzu
 
Custom Tile Generation in PCF
Custom Tile Generation in PCFCustom Tile Generation in PCF
Custom Tile Generation in PCF
Dustin Ruehle
 
12 Introduction to Rails
12 Introduction to Rails12 Introduction to Rails
12 Introduction to Rails
Deepak Hagadur Bheemaraju
 
Power of Azure Devops
Power of Azure DevopsPower of Azure Devops
Power of Azure Devops
Azure Riyadh User Group
 
MEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona WorkshopMEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona Workshop
Valeri Karpov
 
Introduction to cypress in Angular (Chinese)
Introduction to cypress in Angular (Chinese)Introduction to cypress in Angular (Chinese)
Introduction to cypress in Angular (Chinese)
Hong Tat Yew
 
Kubernetes @ meetic
Kubernetes @ meeticKubernetes @ meetic
Kubernetes @ meetic
Sébastien Le Gall
 
Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)
Viral Solani
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
Joram Salinas
 
Cakeph pppt
Cakeph ppptCakeph pppt
Cakeph pppt
Wizard Rider
 
Ei cakephp
Ei cakephpEi cakephp
Ei cakephp
eiei lay
 
Software design with Domain-driven design
Software design with Domain-driven design Software design with Domain-driven design
Software design with Domain-driven design
Allan Mangune
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO Devs
WO Community
 
Tear It Down, Build It Back Up: Empowering Developers with Amazon CloudFormation
Tear It Down, Build It Back Up: Empowering Developers with Amazon CloudFormationTear It Down, Build It Back Up: Empowering Developers with Amazon CloudFormation
Tear It Down, Build It Back Up: Empowering Developers with Amazon CloudFormation
James Andrew Vaughn
 
Beyond Domino Designer
Beyond Domino DesignerBeyond Domino Designer
Beyond Domino Designer
Paul Withers
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven development
Gil Fink
 
Azure Templates for Consistent Deployment
Azure Templates for Consistent DeploymentAzure Templates for Consistent Deployment
Azure Templates for Consistent Deployment
José Maia
 

Similar to Ember - introduction (20)

A Beginner's Guide to Ember
A Beginner's Guide to EmberA Beginner's Guide to Ember
A Beginner's Guide to Ember
 
Ember.js: Jump Start
Ember.js: Jump Start Ember.js: Jump Start
Ember.js: Jump Start
 
Introduction to Monsoon PHP framework
Introduction to Monsoon PHP frameworkIntroduction to Monsoon PHP framework
Introduction to Monsoon PHP framework
 
Custom Tile Generation in PCF
Custom Tile Generation in PCFCustom Tile Generation in PCF
Custom Tile Generation in PCF
 
Custom Tile Generation in PCF
Custom Tile Generation in PCFCustom Tile Generation in PCF
Custom Tile Generation in PCF
 
12 Introduction to Rails
12 Introduction to Rails12 Introduction to Rails
12 Introduction to Rails
 
Power of Azure Devops
Power of Azure DevopsPower of Azure Devops
Power of Azure Devops
 
MEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona WorkshopMEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona Workshop
 
Introduction to cypress in Angular (Chinese)
Introduction to cypress in Angular (Chinese)Introduction to cypress in Angular (Chinese)
Introduction to cypress in Angular (Chinese)
 
Kubernetes @ meetic
Kubernetes @ meeticKubernetes @ meetic
Kubernetes @ meetic
 
Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 
Cakeph pppt
Cakeph ppptCakeph pppt
Cakeph pppt
 
Ei cakephp
Ei cakephpEi cakephp
Ei cakephp
 
Software design with Domain-driven design
Software design with Domain-driven design Software design with Domain-driven design
Software design with Domain-driven design
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO Devs
 
Tear It Down, Build It Back Up: Empowering Developers with Amazon CloudFormation
Tear It Down, Build It Back Up: Empowering Developers with Amazon CloudFormationTear It Down, Build It Back Up: Empowering Developers with Amazon CloudFormation
Tear It Down, Build It Back Up: Empowering Developers with Amazon CloudFormation
 
Beyond Domino Designer
Beyond Domino DesignerBeyond Domino Designer
Beyond Domino Designer
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven development
 
Azure Templates for Consistent Deployment
Azure Templates for Consistent DeploymentAzure Templates for Consistent Deployment
Azure Templates for Consistent Deployment
 

Recently uploaded

UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
YAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring detailsYAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring details
NishanthaBulumulla1
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
GohKiangHock
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
Karya Keeper
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
Rakesh Kumar R
 

Recently uploaded (20)

UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
YAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring detailsYAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring details
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
 

Ember - introduction

  • 1. Ember.js - introduction ‘A framework for creating ambitious web applications’
  • 2. Ember users in Production For more users http://emberjs.com/ember-users/
  • 3. Ember.js: What • Frontend JavaScript web application framework • Based on model-view-controller (MVC) • Used to write complex front-end heavy web apps • Designed for Single Page Applications • Gives you an organized structure, conventions and built-in ways • Like Angular, backbone & knockout, now ember to help developers build great front end application • Key Developers: Yehuda Katz, Tom Dale
  • 4. Ember : why • Logical code organization • Convention similar to Rails background • Easy persistence • Saving or deleting object is easier • Auto-updating templates(Two way binding) • {{ myProperty }} • Helpful Object API’s • Build-in methods • Ember has Array object with methods like contains, filterBy, sortBy, etc • Debugging : The Ember inspector for Firefox and Chrome
  • 6. MVC
  • 7. Ember-cli • Ember CLI aims to be one such Ember.js command line utility that we can use to build, develop and ship ambitious SPA • Includes fast asset pipeline broccoli • Draws heavy inspiration from Rails asset pipeline • Runs on node.js and independent of backend platform • Figures out which files have changed and only rebuilds those that were modified • Assets supported by Broccoli like Handlebars, Emblem, LESS, Sass, Compass, Stylus, CoffeeScript, EmberScript, Minified JS and CSS • Every Ember-cli project will contain a file called Brocfile.js present at the root of the project. This is the definition file and contains build specific instructions of the project. (In latest version of Ember-cli, file renamed to ember-cli-build.js) • Ember CLI uses bower as the default tool to manage the dependencies of our application and lets us to easily manage and keep frontend dependencies up-to-date • Ember CLI uses npm(Node Package Manager) to manage its internal dependencies. • Ember CLI comes with content security add on, this guards from XSS attacks
  • 8. Pre-requisites(To set up application) • Node(npm) • from https://nodejs.org • Ember-cli(ember-cli) • via npm install –g ember-cli • Bower(bower) • via npm install –g bower • PhantomJS(phantomjs) • via npm install –g phantomjs
  • 9. App Folder Structure • Creating a new application • Cmd: ember new my-first-ember-app • Folder Structure
  • 10. App Folder Details• app/components • All components of our application like reusable components used for view or models • app/controllers • Contains the controller modules of our application • app/helpers • Contain all the handlebars helpers for view • app/models • Contain all the ember-data model modules • app/routes • Contains all application routes • app/styles • Contains stylesheets • app/templates • Contains all the handlebars/HTMLBars templates • app/views • Contains all our application views • app/router.js • Contains our route configuration • Routes defined here are resolved from the modules defined in app/routes/
  • 11. App Folder Details cont.. • app/app.js • Main entry point of our application and contains configuration applies to our Ember.js application • Have default generated code which exports our Ember.js application inherits from Ember.Application class • app/index.js • main file for the Single Page web Application. • has the structure of our application, includes js and css files • Includes certain hooks like {{content-for 'head'}}, {{content-for 'head-footer'}}, {{content-for 'body'}}, {{content-for 'body-footer'}}
  • 12. Supporting Files and Folder • bower_components • Contains all dependencies which Ember CLI installs via bower • bower components are listed in bower.json configuration file • config/environment.js • Placeholder of our application configuration • Supports different configurations for different configuration for our application, by default it has created configurations for development, test and production environments • node_modules • Contains the node dependencies used by Ember CLI • public • Contains assets that should be copied as they are to the root of the packaged application • vendor • This folder should contains libraries which cannot be installed using bower or npm • The libraries in vendor should then be imported into the broccoli asset pipeline by adding in Brocfile.js/ember-cli-build.js • test • Contains helpers and resolver to run unit and integration tests using the Ember testing module • Cmd: ember test or http://localhost:4200/test in browser • Ember Cli uses Qunit as its testing library
  • 13. Supporting Files and Folder cont… • brocfile.js/ember-cli-build.js: • Build instructions for broccoli asset pipeline • Additional libraries included if we import the files • Eg: app.import(‘bower_components/bootstrap/dist/css/bootstrap.css’); • bower.json • Configuration file for bower and contains the dependencies of our application that need to installed via bower • package.json • Configuration file for npm and contains node.js dependencies required by our application
  • 14. Running the application • Cmd : ember server • By default runs on 4200 port • For different port • Cmd: ember server –port 4300 Or Add configuration in .ember-cli by adding {“port”: 4300}
  • 15. • Ember.js strongly relies on naming conventions. So, if you want the page /foo in your app, you will have the following: • a foo template, • a FooRoute, • a FooController, • and a FooView.
  • 16. Components • Router/Route • Controller • Model • View/Component • Templates
  • 18. The router • Routes are the root of all other concepts in Ember • The router drives the rest of the gears in ember router.js eg:- this.route(‘users’); Route class • Sets up the model (data) and the controller • Will take actions/events that bubble up it from the controller
  • 19. Models • Defines the data you need • Uses attributes for defining the data type: number, boolean, string, etc. • Also uses relational mapping for defining relationship between models: hasMany, belongsTo, etc.
  • 20. Controller • Takes the model from the route • Model can be an object or an array/collection • Is responsible for: • Mutating the model • User interaction • Page logic • Can define observable and computed properties
  • 21. Template(Handlebars markup) • Uses Handlebars as the rendering language • Mostly plain old HTML • Hooks to controller - provides the logic • Hooks to the model - provides the data
  • 22. View • A class for when doing DOM manipulation is necessary • If you need to do DOM manipulation, you should ask yourself what you may be doing wrong • Should not be used often
  • 23. Components • Reusable parts • Your own HTML tags/elements • Any part of your application that repeats is a candidate for a component • Ember comes with a bunch of these: • Input box helpers, dropdown menu, links, etc.
  • 24. Adapter If caching happens Architecture overview For a new Record
  • 25. Note on coupling - In Ember.js, templates get their properties from controllers, which decorate a model. - templates know about controllers and controllers know about models, but the reverse is not true. A model knows nothing about which (if any) controllers are decorating it, and a controller does not know which templates are presenting its properties. - For example, if the user navigates from /posts/1 to /posts/2, the PostController's model will change from store.findRecord('post', 1) to store.findRecord('post', 2). The template will update its representations of any properties on the model, as well as any computed properties on the controller that depend on the model.
  • 26. Example for routes and its components
  • 27. Few Codes • To define a new Ember class, call the extend() method on Ember.Object • Eg:- • Person = Ember.Object.extend({ say(thing) { var name = this.get('name'); alert(name + " says: " + thing); } }); • RETRIEVING A SINGLE RECORD • var post = this.store.findRecord('post', 1); // => GET /posts/1 • var post = this.store.peekRecord('post', 1); // => no network request • RETRIEVING MULTIPLE RECORDS • var posts = this.store.findAll('post'); // => GET /posts • var posts = this.store.peekAll('post'); // => no network request • QUERYING FOR MULTIPLE RECORDS • var peters = this.store.query('person', { name: 'Peter' }); // => GET to /persons?name=Peter
  • 28. FewNotes • EMBER.OBJECT • Ember implements its own object system. The base object is Ember.Object. All of the other objects in Ember extend Ember.Object. • user = Ember.Object.create() • user = Ember.Object.create({ firstName: hari', lastName: c' }) • Getter • user.firstName or user.get(‘firstName’) • CLASSES • var Person = Ember.Object.extend({ say: function (message) { alert(message); } }); • var bob = Person.create(); bob.say('hello world'); • // alerts "hello world" • Ember-Data • Ember-Data is a library that lets you retrieve records from a server, hold them in a Store, update them in the browser and, finally, save them back to the server. The Store can be configured with various adapters • RESTAdapter interacts with a JSON API • LSAdapter persists your data in the browser’s local storage
  • 29. Resources • http://guides.emberjs.com/ • http://emberwatch.com/tutorials.html • https://en.wikipedia.org/wiki/Ember.js • Ebook: Ember.js Web development with Ember CLI – Suchit Puri • Ebook: Ember-cli-101: An Ember.js book with ember-cli • Lynda.com, codeschool • Youtube tutorials • Dockyard.com ember tutorial

Editor's Notes

  1. AJAX – Asynchronous Javascript and XML In 2007 – check from above image In 2008, Sproutcore become popular when Apple announced that MobileMe, iCloud application was using this framework. In 2011, Sproutcore 2 framework was renamed to Ember.js to distinguish from Sproutcore 1.x. Ember.js introduced the MVC design pattern to build the modern single page web application Latest version is Ember-cli (CLI – Command Line Interface) has more command line similar to Rails to generate codes… Eg., ember generate controller, … adapter, model, resources(routes and model)
  2. user = Ember.Object.create({ firstName: 'Sam', lastName: 'Smith' })
  3. Show the code from IDE Explain about
  4. Router: Entry point of the application Manages the state of the application by monitoring the URL patterns and then instantiates the Controller and Model objects Controller: Manage the transient state of the application, a state that is not persisted to the server Change or decorate the properties of the model object to present the users Model: Encapsulate the data on which controllers and views work Define properties and behavior View/Component: Encapsulate templates and enable us to make custom reusable elements Templates: Mostly handlebars templates are used Handlebar Templates are a mix of HTML markup and custom markup to bind the data present in controllers and models with the view Can also use other templates as well.. Like emblem,etc
  5. Person = Ember.Object.extend({ say(thing) { alert(thing); } }); var person = Person.create(); // create instances Person.say(‘test’); // call the specific method Eg:- To create with the initial value Person = Ember.Object.extend({ helloWorld() { alert("Hi, my name is " + this.get('name')); } }); var tom = Person.create({ name: "Tom Dale" }); tom.helloWorld(); // alerts "Hi, my name is Tom Dale"
  6. Most Ember.js applications use Ember Data,[ a data persistence library providing many of the facilities of an object-relational mapping (ORM). However it is also possible to use Ember.js without Ember Data.  However it is also easily configurable and can work with any server through the use of adapters and addons.[40]  JSON API has server library implementations for PHP, Node.js, Ruby, Python, Go, .NET and Java.[41] Connecting to a Java-Spring based server is also documented.[42] The first stable version of Ember Data (labelled 1.13 to align with Ember itself) was released on 18 June 2015.[43]