SlideShare a Scribd company logo
EMBER REUSABLE
COMPONENTS
&
WIDGETS
EmberFest, Germany, 2013
brought by
Sergey N. Bolshchikov
ME
❖ Front-end engineer @ New ProImage, Israel
Allgauer Zeitung – Kempten
Rheinische Post – Dusseldorf
Druckzentrum Rhein Main – Russelsheim
Bold Printing – Sweden
News International - England
The Wall Street Journal - USA
❖ Co-organizer of Ember-IL meetup, Tel-Aviv
YOU
Heard of Web Components?
Used Ember Components?
OUTLINE
1. History Future
1.1. Web components
1.2. Ember before rc6
1.3. Ember after rc6
2. Building
2.1. Requirements
2.2. Defining components
2.3. Usage
2.4. Customization
WIDGETS?
WIDGETS?
jQuery plugins
Bootstrap
WIDGETS?
It’s all about to change
with
WEB COMPONENTS
WEB COMPONENTS :: WHY?
Global namespace collisions
No modules encapsulation
No code reuse
WEB COMPONENTS :: WHY?
Global namespace collisions
No modules encapsulation
No code reuse
SOLVED
for JavaScript
WEB COMPONENTS :: WHY?
Global namespace collisions
No modules encapsulation
No code reuse
What about HTML, CSS?
WEB COMPONENTS
Web Components is a
● set of specs which let web developers
● leverage their HTML, CSS and JavaScript
knowledge
● to build widgets
● that can be reused easily and reliably.*
*source: http://www.chromium.org/blink/web-components
WEB COMPONENTS in a nutshell
<element name="tick-tock-clock">
<template>
<span id="hh"></span>
<span id="sep">:</span>
<span id="mm"></span>
</template>
<script>
({
tick: function () {
…
}
});
</script>
</element>
WEB COMPONENTS
<element name="tick-tock-clock">
<template>
<span id="hh"></span>
<span id="sep">:</span>
<span id="mm"></span>
</template>
<script>
({
tick: function () {
…
}
});
</script>
</element>
WEB COMPONENTS
<element name="tick-tock-clock">
<template>
<span id="hh"></span>
<span id="sep">:</span>
<span id="mm"></span>
</template>
<script>
({
tick: function () {
…
}
});
</script>
</element>
WEB COMPONENTS
<html>
<body>
<tick-tock-clock></tick-tock-clock>
</body>
</html>
Usage:
ember BEFORE rc6
CONTROLLER
VIEW TEMPLATE
ember AFTER rc6
EMBER COMPONENT
VIEW CONTROLLER
EMBER COMPONENTS
● Web Component ember mock
● Real re-usable components
● By encapsulating html and javascript
● And use
<script type=”text/x-handlebars”>
{{component-name}}
</script>
EMBER COMPONENTS FOR NERDS
Ember.Component = Ember.View.extend({
init: function() {
this._super();
set(this, 'context', this);
set(this, 'controller', this);
}
});
http://jsbin.com/odUZEri/2/
CODE
TASK
Create a progress bar widget
23 / 100
1. DEFINE A TEMPLATE
<script type=”text/x-handlebars” id=”components/progress-bar”
>
<div class=”bar”>
<div class=”progress”></div>
</div>
</script>
HTML
1. DEFINE A TEMPLATE
<script type=”text/x-handlebars” id=”components/progress-bar”
>
<div class=”bar”>
<div class=”progress”></div>
</div>
</script>
HTML
a name of a template should starts with
components/ and should be dashed
HTML
1. DEFINE A TEMPLATE
a name of a template should starts with
components/ and should be dashed
progress bar
consists of outer
div as a bar with
fixed width, and
inside div with
various width in
% as a progress
<script type=”text/x-handlebars” id=”components/progress-bar”
>
<div class=”bar”>
<div class=”progress”></div>
</div>
</script>
2. USAGE
<script type=”text/x-handlebars” id=”application”>
{{progress-bar}}
</script>
HTML
3. PASSING PARAMETERS
App = Ember.Application.create({
events: 23
});
JS
<script type=”text/x-handlebars” id=”application”>
{{progress-bar progress=App.events}}
</script>
HTML
4. CUSTOMIZING COMPONENT
App.ProgressBarComponent = Ember.Components.extend({
// you code goes here
});
JS
For component customization, we inherit from the
Ember.Component and name it according to the
convention: classified name of the component with the
reserved word `Component` at the end.
4. CUSTOMIZING COMPONENT
App.ProgressBarComponent = Ember.Components.extend({
style: function () {
return 'width: ' + this.get('progress') + '%';
}.property('App.events'),
}); JS
<script type="text/x-handlebars" id="components/progress-bar"
>
<div class="bar">
<div class="progress" {{bind-attr style=style}}></div>
</div>
</script> HTML
5. ADD CONTENT
<script type="text/x-handlebars" id="components/progress-bar"
>
<div class="bar">
<div class="progress" {{bind-attr style=style}}></div>
<span>{{yield}}</span>
</div>
</script> HTML
<script type="text/x-handlebars" id=”application”>
{{#progress-bar progress=App.events}}
{{view.progress}} / 100
{{/progress-bar}}
</script> HTML
6. ADD ACTION
App.ProgressBarComponent = Ember.Components.extend({
style: function () {
return 'width: ' + this.get('progress') + '%';
}.property('App.events'),
hello: function () {
console.log('hello component action');
}
}); JS
<script type="text/x-handlebars" id="components/progress-bar"
>
<div class="bar" {{action 'hello'}}>
<div class="progress" {{bind-attr style=style}}></div>
<span>{{yield}}</span>
</div>
</script> HTML
7. SEND ACTION
<script type="text/x-handlebars" id="components/progress-bar"
>
<div class="bar" {{action 'proxy'}}>
<div class="progress" {{bind-attr style=style}}></div>
<span>{{yield}}</span>
</div>
</script> HTML
7. SEND ACTION
App.ApplicationController = Ember.Controller.extend({
hello: function () {
console.log('hello EmberFest');
}
});
App.ProgressBarComponent = Ember.Component.extend({
style: function () {
return 'width: ' + this.get('progress') + '%';
}.property('App.events'),
proxy: function () {
console.log('passing on');
this.sendAction();
},
action: 'hello'
});
JS
Hosting controller that has hello method
7. SEND ACTION
App.ApplicationController = Ember.Controller.extend({
hello: function () {
console.log('hello EmberFest');
}
});
App.ProgressBarComponent = Ember.Component.extend({
style: function () {
return 'width: ' + this.get('progress') + '%';
}.property('App.events'),
proxy: function () {
console.log('passing on');
this.sendAction();
},
action: 'hello'
});
JS
Hosting controller that has hello method
Specify action name to be invoked in hosting controller
7. SEND ACTION
App.ApplicationController = Ember.Controller.extend({
hello: function () {
console.log('hello EmberFest');
}
});
App.ProgressBarComponent = Ember.Component.extend({
style: function () {
return 'width: ' + this.get('progress') + '%';
}.property('App.events'),
proxy: function () {
console.log('passing on');
this.sendAction();
},
action: 'hello'
});
JS
Hosting controller that has hello method
Specify action name to be invoked in hosting controller
Invoke the specified action
TAKEAWAYS
● define template: ‘components/my-comp’
● use: {{my-comp}}
● parameterize: {{my-comp param=newPar}}
● customize: App.MyCompComponent
● be careful with {{yield}}
● sendAction method (not in guides/API)
● specify ‘action’ property in
MyCompComponent
THANKS!
Ad

More Related Content

What's hot (20)

The Evolution of Airbnb's Frontend
The Evolution of Airbnb's FrontendThe Evolution of Airbnb's Frontend
The Evolution of Airbnb's Frontend
Spike Brehm
 
RoR 101: Session 6
RoR 101: Session 6RoR 101: Session 6
RoR 101: Session 6
Rory Gianni
 
A Toda Maquina Con Ruby on Rails
A Toda Maquina Con Ruby on RailsA Toda Maquina Con Ruby on Rails
A Toda Maquina Con Ruby on Rails
Rafael García
 
Full slidescr16
Full slidescr16Full slidescr16
Full slidescr16
Lucio Grenzi
 
RoR 101: Session 2
RoR 101: Session 2RoR 101: Session 2
RoR 101: Session 2
Rory Gianni
 
Workshop 16: EmberJS Parte I
Workshop 16: EmberJS Parte IWorkshop 16: EmberJS Parte I
Workshop 16: EmberJS Parte I
Visual Engineering
 
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Matt Raible
 
RoR 101: Session 6
RoR 101: Session 6RoR 101: Session 6
RoR 101: Session 6
Rory Gianni
 
How to Build ToDo App with Vue 3 + TypeScript
How to Build ToDo App with Vue 3 + TypeScriptHow to Build ToDo App with Vue 3 + TypeScript
How to Build ToDo App with Vue 3 + TypeScript
Katy Slemon
 
AngularJS 2.0
AngularJS 2.0AngularJS 2.0
AngularJS 2.0
Boyan Mihaylov
 
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
In The Trenches With Tomster, Upgrading Ember.js & Ember DataIn The Trenches With Tomster, Upgrading Ember.js & Ember Data
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
Stacy London
 
Angular 5
Angular 5Angular 5
Angular 5
Bartłomiej Narożnik
 
Curso rails
Curso railsCurso rails
Curso rails
Icalia Labs
 
Angularjs
AngularjsAngularjs
Angularjs
Vincenzo Ferrari
 
Rest web service_with_spring_hateoas
Rest web service_with_spring_hateoasRest web service_with_spring_hateoas
Rest web service_with_spring_hateoas
Zeid Hassan
 
Laravel mail example how to send an email using markdown template in laravel 8
Laravel mail example how to send an email using markdown template in laravel 8Laravel mail example how to send an email using markdown template in laravel 8
Laravel mail example how to send an email using markdown template in laravel 8
Katy Slemon
 
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
Sencha
 
Jasig Rubyon Rails
Jasig Rubyon RailsJasig Rubyon Rails
Jasig Rubyon Rails
Paul Pajo
 
Angular elements - embed your angular components EVERYWHERE
Angular elements - embed your angular components EVERYWHEREAngular elements - embed your angular components EVERYWHERE
Angular elements - embed your angular components EVERYWHERE
Nadav Mary
 
JOSA TechTalks - Better Web Apps with React and Redux
JOSA TechTalks - Better Web Apps with React and ReduxJOSA TechTalks - Better Web Apps with React and Redux
JOSA TechTalks - Better Web Apps with React and Redux
Jordan Open Source Association
 
The Evolution of Airbnb's Frontend
The Evolution of Airbnb's FrontendThe Evolution of Airbnb's Frontend
The Evolution of Airbnb's Frontend
Spike Brehm
 
RoR 101: Session 6
RoR 101: Session 6RoR 101: Session 6
RoR 101: Session 6
Rory Gianni
 
A Toda Maquina Con Ruby on Rails
A Toda Maquina Con Ruby on RailsA Toda Maquina Con Ruby on Rails
A Toda Maquina Con Ruby on Rails
Rafael García
 
RoR 101: Session 2
RoR 101: Session 2RoR 101: Session 2
RoR 101: Session 2
Rory Gianni
 
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Matt Raible
 
RoR 101: Session 6
RoR 101: Session 6RoR 101: Session 6
RoR 101: Session 6
Rory Gianni
 
How to Build ToDo App with Vue 3 + TypeScript
How to Build ToDo App with Vue 3 + TypeScriptHow to Build ToDo App with Vue 3 + TypeScript
How to Build ToDo App with Vue 3 + TypeScript
Katy Slemon
 
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
In The Trenches With Tomster, Upgrading Ember.js & Ember DataIn The Trenches With Tomster, Upgrading Ember.js & Ember Data
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
Stacy London
 
Rest web service_with_spring_hateoas
Rest web service_with_spring_hateoasRest web service_with_spring_hateoas
Rest web service_with_spring_hateoas
Zeid Hassan
 
Laravel mail example how to send an email using markdown template in laravel 8
Laravel mail example how to send an email using markdown template in laravel 8Laravel mail example how to send an email using markdown template in laravel 8
Laravel mail example how to send an email using markdown template in laravel 8
Katy Slemon
 
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
Sencha
 
Jasig Rubyon Rails
Jasig Rubyon RailsJasig Rubyon Rails
Jasig Rubyon Rails
Paul Pajo
 
Angular elements - embed your angular components EVERYWHERE
Angular elements - embed your angular components EVERYWHEREAngular elements - embed your angular components EVERYWHERE
Angular elements - embed your angular components EVERYWHERE
Nadav Mary
 

Viewers also liked (20)

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
 
Starting up with UX: User centered Design Process, Usability & UX
Starting up with UX: User centered Design Process, Usability & UXStarting up with UX: User centered Design Process, Usability & UX
Starting up with UX: User centered Design Process, Usability & UX
Found.ation
 
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
 
Compliance Day 2015 iiR
Compliance Day 2015 iiR Compliance Day 2015 iiR
Compliance Day 2015 iiR
Hernan Huwyler, MBA CPA
 
11.expression of emerging novel tumor markers in oral squamous cell carcinoma...
11.expression of emerging novel tumor markers in oral squamous cell carcinoma...11.expression of emerging novel tumor markers in oral squamous cell carcinoma...
11.expression of emerging novel tumor markers in oral squamous cell carcinoma...
Alexander Decker
 
Techo verde
Techo verdeTecho verde
Techo verde
Jimmy Usurin Canchari
 
G. amaya tema i ii y iii
G. amaya tema i ii y iiiG. amaya tema i ii y iii
G. amaya tema i ii y iii
gilberto_amaya
 
Cte2014 15sesionmayo-150514010555-lva1-app6892
Cte2014 15sesionmayo-150514010555-lva1-app6892Cte2014 15sesionmayo-150514010555-lva1-app6892
Cte2014 15sesionmayo-150514010555-lva1-app6892
Antonio Mendoza
 
Catálogo bodegas Elfesu
Catálogo bodegas Elfesu Catálogo bodegas Elfesu
Catálogo bodegas Elfesu
Elfesu Bodegas
 
Papa.fancisco añofe,32..la iglesia el templo
Papa.fancisco añofe,32..la iglesia el temploPapa.fancisco añofe,32..la iglesia el templo
Papa.fancisco añofe,32..la iglesia el templo
emilioperucha
 
Curso homologado diabetes enfermeria
Curso homologado diabetes enfermeriaCurso homologado diabetes enfermeria
Curso homologado diabetes enfermeria
Euroinnova Formación
 
.
..
.
SCREAM of Rugby
 
Folleto produccion documental
Folleto produccion documentalFolleto produccion documental
Folleto produccion documental
HostingyWeb
 
Leopold Pilsbacher: Kinderlebensmittel sind sicher
Leopold Pilsbacher: Kinderlebensmittel sind sicherLeopold Pilsbacher: Kinderlebensmittel sind sicher
Leopold Pilsbacher: Kinderlebensmittel sind sicher
AGES - Österreichische Agentur für Gesundheit und Ernährungssicherheit
 
MAPAS CONCEPTUALES DE FILOSOFÍA
MAPAS CONCEPTUALES DE FILOSOFÍAMAPAS CONCEPTUALES DE FILOSOFÍA
MAPAS CONCEPTUALES DE FILOSOFÍA
Iván Darío Quintero Valencia
 
Intro to Ember.js
Intro to Ember.jsIntro to Ember.js
Intro to Ember.js
Jay Phelps
 
An introduction to Ember.js
An introduction to Ember.jsAn introduction to Ember.js
An introduction to Ember.js
codeofficer
 
Starting up with UX: User centered Design Process, Usability & UX
Starting up with UX: User centered Design Process, Usability & UXStarting up with UX: User centered Design Process, Usability & UX
Starting up with UX: User centered Design Process, Usability & UX
Found.ation
 
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
 
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
 
11.expression of emerging novel tumor markers in oral squamous cell carcinoma...
11.expression of emerging novel tumor markers in oral squamous cell carcinoma...11.expression of emerging novel tumor markers in oral squamous cell carcinoma...
11.expression of emerging novel tumor markers in oral squamous cell carcinoma...
Alexander Decker
 
G. amaya tema i ii y iii
G. amaya tema i ii y iiiG. amaya tema i ii y iii
G. amaya tema i ii y iii
gilberto_amaya
 
Cte2014 15sesionmayo-150514010555-lva1-app6892
Cte2014 15sesionmayo-150514010555-lva1-app6892Cte2014 15sesionmayo-150514010555-lva1-app6892
Cte2014 15sesionmayo-150514010555-lva1-app6892
Antonio Mendoza
 
Catálogo bodegas Elfesu
Catálogo bodegas Elfesu Catálogo bodegas Elfesu
Catálogo bodegas Elfesu
Elfesu Bodegas
 
Papa.fancisco añofe,32..la iglesia el templo
Papa.fancisco añofe,32..la iglesia el temploPapa.fancisco añofe,32..la iglesia el templo
Papa.fancisco añofe,32..la iglesia el templo
emilioperucha
 
Curso homologado diabetes enfermeria
Curso homologado diabetes enfermeriaCurso homologado diabetes enfermeria
Curso homologado diabetes enfermeria
Euroinnova Formación
 
Folleto produccion documental
Folleto produccion documentalFolleto produccion documental
Folleto produccion documental
HostingyWeb
 
Ad

Similar to Ember Reusable Components and Widgets (20)

Google Glass Mirror API Setup
Google Glass Mirror API SetupGoogle Glass Mirror API Setup
Google Glass Mirror API Setup
Diana Michelle
 
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
 
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
Paul Jensen
 
Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpack
NodeXperts
 
Magnolia & Angular JS - an Approach for Javascript RIAs Delivered by a CMS
Magnolia & Angular JS - an Approach for Javascript RIAs Delivered by a CMSMagnolia & Angular JS - an Approach for Javascript RIAs Delivered by a CMS
Magnolia & Angular JS - an Approach for Javascript RIAs Delivered by a CMS
Magnolia
 
App engine devfest_mexico_10
App engine devfest_mexico_10App engine devfest_mexico_10
App engine devfest_mexico_10
Chris Schalk
 
Angularjs2 presentation
Angularjs2 presentationAngularjs2 presentation
Angularjs2 presentation
dharisk
 
Refactor Large apps with Backbone
Refactor Large apps with BackboneRefactor Large apps with Backbone
Refactor Large apps with Backbone
devObjective
 
Refactoring Large Web Applications with Backbone.js
Refactoring Large Web Applications with Backbone.jsRefactoring Large Web Applications with Backbone.js
Refactoring Large Web Applications with Backbone.js
Stacy London
 
Refactor Large applications with Backbone
Refactor Large applications with BackboneRefactor Large applications with Backbone
Refactor Large applications with Backbone
ColdFusionConference
 
Javaland 2014 / GWT architectures and lessons learned
Javaland 2014 / GWT architectures and lessons learnedJavaland 2014 / GWT architectures and lessons learned
Javaland 2014 / GWT architectures and lessons learned
pgt technology scouting GmbH
 
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan
 
Building a p2 update site using Buckminster
Building a p2 update site using BuckminsterBuilding a p2 update site using Buckminster
Building a p2 update site using Buckminster
guest5e2b6b
 
Parse Apps with Ember.js
Parse Apps with Ember.jsParse Apps with Ember.js
Parse Apps with Ember.js
Matthew Beale
 
React Basic and Advance || React Basic
React Basic and Advance   || React BasicReact Basic and Advance   || React Basic
React Basic and Advance || React Basic
rafaqathussainc077
 
Remote Config REST API and Versioning
Remote Config REST API and VersioningRemote Config REST API and Versioning
Remote Config REST API and Versioning
Jumpei Matsuda
 
Dive into Angular, part 5: Experience
Dive into Angular, part 5: ExperienceDive into Angular, part 5: Experience
Dive into Angular, part 5: Experience
Oleksii Prohonnyi
 
Google app engine by example
Google app engine by exampleGoogle app engine by example
Google app engine by example
Alexander Zamkovyi
 
Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014
Lou Sacco
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017
Matt Raible
 
Google Glass Mirror API Setup
Google Glass Mirror API SetupGoogle Glass Mirror API Setup
Google Glass Mirror API Setup
Diana Michelle
 
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
 
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
Paul Jensen
 
Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpack
NodeXperts
 
Magnolia & Angular JS - an Approach for Javascript RIAs Delivered by a CMS
Magnolia & Angular JS - an Approach for Javascript RIAs Delivered by a CMSMagnolia & Angular JS - an Approach for Javascript RIAs Delivered by a CMS
Magnolia & Angular JS - an Approach for Javascript RIAs Delivered by a CMS
Magnolia
 
App engine devfest_mexico_10
App engine devfest_mexico_10App engine devfest_mexico_10
App engine devfest_mexico_10
Chris Schalk
 
Angularjs2 presentation
Angularjs2 presentationAngularjs2 presentation
Angularjs2 presentation
dharisk
 
Refactor Large apps with Backbone
Refactor Large apps with BackboneRefactor Large apps with Backbone
Refactor Large apps with Backbone
devObjective
 
Refactoring Large Web Applications with Backbone.js
Refactoring Large Web Applications with Backbone.jsRefactoring Large Web Applications with Backbone.js
Refactoring Large Web Applications with Backbone.js
Stacy London
 
Refactor Large applications with Backbone
Refactor Large applications with BackboneRefactor Large applications with Backbone
Refactor Large applications with Backbone
ColdFusionConference
 
Javaland 2014 / GWT architectures and lessons learned
Javaland 2014 / GWT architectures and lessons learnedJavaland 2014 / GWT architectures and lessons learned
Javaland 2014 / GWT architectures and lessons learned
pgt technology scouting GmbH
 
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan
 
Building a p2 update site using Buckminster
Building a p2 update site using BuckminsterBuilding a p2 update site using Buckminster
Building a p2 update site using Buckminster
guest5e2b6b
 
Parse Apps with Ember.js
Parse Apps with Ember.jsParse Apps with Ember.js
Parse Apps with Ember.js
Matthew Beale
 
React Basic and Advance || React Basic
React Basic and Advance   || React BasicReact Basic and Advance   || React Basic
React Basic and Advance || React Basic
rafaqathussainc077
 
Remote Config REST API and Versioning
Remote Config REST API and VersioningRemote Config REST API and Versioning
Remote Config REST API and Versioning
Jumpei Matsuda
 
Dive into Angular, part 5: Experience
Dive into Angular, part 5: ExperienceDive into Angular, part 5: Experience
Dive into Angular, part 5: Experience
Oleksii Prohonnyi
 
Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014
Lou Sacco
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017
Matt Raible
 
Ad

More from Sergey Bolshchikov (14)

Onboarding for Software Engineers Done Right
Onboarding for Software Engineers Done RightOnboarding for Software Engineers Done Right
Onboarding for Software Engineers Done Right
Sergey Bolshchikov
 
Pragmatic React Workshop
Pragmatic React WorkshopPragmatic React Workshop
Pragmatic React Workshop
Sergey Bolshchikov
 
Microservices on the client side
Microservices on the client sideMicroservices on the client side
Microservices on the client side
Sergey Bolshchikov
 
ES2015 Quiz
ES2015 QuizES2015 Quiz
ES2015 Quiz
Sergey Bolshchikov
 
Talking code: How To
Talking code: How ToTalking code: How To
Talking code: How To
Sergey Bolshchikov
 
Values & Culture of Continuous Deliver
Values & Culture of Continuous DeliverValues & Culture of Continuous Deliver
Values & Culture of Continuous Deliver
Sergey Bolshchikov
 
Protractor: Tips & Tricks
Protractor: Tips & TricksProtractor: Tips & Tricks
Protractor: Tips & Tricks
Sergey Bolshchikov
 
Continuous Delivery for Front-End Engineers
Continuous Delivery for Front-End EngineersContinuous Delivery for Front-End Engineers
Continuous Delivery for Front-End Engineers
Sergey Bolshchikov
 
Зачем нужен EmberJS, если мне хвататет jQuery
Зачем нужен EmberJS, если мне хвататет jQueryЗачем нужен EmberJS, если мне хвататет jQuery
Зачем нужен EmberJS, если мне хвататет jQuery
Sergey Bolshchikov
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important Parts
Sergey Bolshchikov
 
Web Projects: From Theory To Practice
Web Projects: From Theory To PracticeWeb Projects: From Theory To Practice
Web Projects: From Theory To Practice
Sergey Bolshchikov
 
AngularJS Basics with Example
AngularJS Basics with ExampleAngularJS Basics with Example
AngularJS Basics with Example
Sergey Bolshchikov
 
Backbone Basics with Examples
Backbone Basics with ExamplesBackbone Basics with Examples
Backbone Basics with Examples
Sergey Bolshchikov
 
JS Single-Page Web App Essentials
JS Single-Page Web App EssentialsJS Single-Page Web App Essentials
JS Single-Page Web App Essentials
Sergey Bolshchikov
 
Onboarding for Software Engineers Done Right
Onboarding for Software Engineers Done RightOnboarding for Software Engineers Done Right
Onboarding for Software Engineers Done Right
Sergey Bolshchikov
 
Microservices on the client side
Microservices on the client sideMicroservices on the client side
Microservices on the client side
Sergey Bolshchikov
 
Values & Culture of Continuous Deliver
Values & Culture of Continuous DeliverValues & Culture of Continuous Deliver
Values & Culture of Continuous Deliver
Sergey Bolshchikov
 
Continuous Delivery for Front-End Engineers
Continuous Delivery for Front-End EngineersContinuous Delivery for Front-End Engineers
Continuous Delivery for Front-End Engineers
Sergey Bolshchikov
 
Зачем нужен EmberJS, если мне хвататет jQuery
Зачем нужен EmberJS, если мне хвататет jQueryЗачем нужен EmberJS, если мне хвататет jQuery
Зачем нужен EmberJS, если мне хвататет jQuery
Sergey Bolshchikov
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important Parts
Sergey Bolshchikov
 
Web Projects: From Theory To Practice
Web Projects: From Theory To PracticeWeb Projects: From Theory To Practice
Web Projects: From Theory To Practice
Sergey Bolshchikov
 
JS Single-Page Web App Essentials
JS Single-Page Web App EssentialsJS Single-Page Web App Essentials
JS Single-Page Web App Essentials
Sergey Bolshchikov
 

Recently uploaded (20)

AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 

Ember Reusable Components and Widgets

  • 1. EMBER REUSABLE COMPONENTS & WIDGETS EmberFest, Germany, 2013 brought by Sergey N. Bolshchikov
  • 2. ME ❖ Front-end engineer @ New ProImage, Israel Allgauer Zeitung – Kempten Rheinische Post – Dusseldorf Druckzentrum Rhein Main – Russelsheim Bold Printing – Sweden News International - England The Wall Street Journal - USA ❖ Co-organizer of Ember-IL meetup, Tel-Aviv
  • 3. YOU Heard of Web Components? Used Ember Components?
  • 4. OUTLINE 1. History Future 1.1. Web components 1.2. Ember before rc6 1.3. Ember after rc6 2. Building 2.1. Requirements 2.2. Defining components 2.3. Usage 2.4. Customization
  • 7. WIDGETS? It’s all about to change with WEB COMPONENTS
  • 8. WEB COMPONENTS :: WHY? Global namespace collisions No modules encapsulation No code reuse
  • 9. WEB COMPONENTS :: WHY? Global namespace collisions No modules encapsulation No code reuse SOLVED for JavaScript
  • 10. WEB COMPONENTS :: WHY? Global namespace collisions No modules encapsulation No code reuse What about HTML, CSS?
  • 11. WEB COMPONENTS Web Components is a ● set of specs which let web developers ● leverage their HTML, CSS and JavaScript knowledge ● to build widgets ● that can be reused easily and reliably.* *source: http://www.chromium.org/blink/web-components
  • 12. WEB COMPONENTS in a nutshell <element name="tick-tock-clock"> <template> <span id="hh"></span> <span id="sep">:</span> <span id="mm"></span> </template> <script> ({ tick: function () { … } }); </script> </element>
  • 13. WEB COMPONENTS <element name="tick-tock-clock"> <template> <span id="hh"></span> <span id="sep">:</span> <span id="mm"></span> </template> <script> ({ tick: function () { … } }); </script> </element>
  • 14. WEB COMPONENTS <element name="tick-tock-clock"> <template> <span id="hh"></span> <span id="sep">:</span> <span id="mm"></span> </template> <script> ({ tick: function () { … } }); </script> </element>
  • 17. ember AFTER rc6 EMBER COMPONENT VIEW CONTROLLER
  • 18. EMBER COMPONENTS ● Web Component ember mock ● Real re-usable components ● By encapsulating html and javascript ● And use <script type=”text/x-handlebars”> {{component-name}} </script>
  • 19. EMBER COMPONENTS FOR NERDS Ember.Component = Ember.View.extend({ init: function() { this._super(); set(this, 'context', this); set(this, 'controller', this); } });
  • 21. TASK Create a progress bar widget 23 / 100
  • 22. 1. DEFINE A TEMPLATE <script type=”text/x-handlebars” id=”components/progress-bar” > <div class=”bar”> <div class=”progress”></div> </div> </script> HTML
  • 23. 1. DEFINE A TEMPLATE <script type=”text/x-handlebars” id=”components/progress-bar” > <div class=”bar”> <div class=”progress”></div> </div> </script> HTML a name of a template should starts with components/ and should be dashed
  • 24. HTML 1. DEFINE A TEMPLATE a name of a template should starts with components/ and should be dashed progress bar consists of outer div as a bar with fixed width, and inside div with various width in % as a progress <script type=”text/x-handlebars” id=”components/progress-bar” > <div class=”bar”> <div class=”progress”></div> </div> </script>
  • 25. 2. USAGE <script type=”text/x-handlebars” id=”application”> {{progress-bar}} </script> HTML
  • 26. 3. PASSING PARAMETERS App = Ember.Application.create({ events: 23 }); JS <script type=”text/x-handlebars” id=”application”> {{progress-bar progress=App.events}} </script> HTML
  • 27. 4. CUSTOMIZING COMPONENT App.ProgressBarComponent = Ember.Components.extend({ // you code goes here }); JS For component customization, we inherit from the Ember.Component and name it according to the convention: classified name of the component with the reserved word `Component` at the end.
  • 28. 4. CUSTOMIZING COMPONENT App.ProgressBarComponent = Ember.Components.extend({ style: function () { return 'width: ' + this.get('progress') + '%'; }.property('App.events'), }); JS <script type="text/x-handlebars" id="components/progress-bar" > <div class="bar"> <div class="progress" {{bind-attr style=style}}></div> </div> </script> HTML
  • 29. 5. ADD CONTENT <script type="text/x-handlebars" id="components/progress-bar" > <div class="bar"> <div class="progress" {{bind-attr style=style}}></div> <span>{{yield}}</span> </div> </script> HTML <script type="text/x-handlebars" id=”application”> {{#progress-bar progress=App.events}} {{view.progress}} / 100 {{/progress-bar}} </script> HTML
  • 30. 6. ADD ACTION App.ProgressBarComponent = Ember.Components.extend({ style: function () { return 'width: ' + this.get('progress') + '%'; }.property('App.events'), hello: function () { console.log('hello component action'); } }); JS <script type="text/x-handlebars" id="components/progress-bar" > <div class="bar" {{action 'hello'}}> <div class="progress" {{bind-attr style=style}}></div> <span>{{yield}}</span> </div> </script> HTML
  • 31. 7. SEND ACTION <script type="text/x-handlebars" id="components/progress-bar" > <div class="bar" {{action 'proxy'}}> <div class="progress" {{bind-attr style=style}}></div> <span>{{yield}}</span> </div> </script> HTML
  • 32. 7. SEND ACTION App.ApplicationController = Ember.Controller.extend({ hello: function () { console.log('hello EmberFest'); } }); App.ProgressBarComponent = Ember.Component.extend({ style: function () { return 'width: ' + this.get('progress') + '%'; }.property('App.events'), proxy: function () { console.log('passing on'); this.sendAction(); }, action: 'hello' }); JS Hosting controller that has hello method
  • 33. 7. SEND ACTION App.ApplicationController = Ember.Controller.extend({ hello: function () { console.log('hello EmberFest'); } }); App.ProgressBarComponent = Ember.Component.extend({ style: function () { return 'width: ' + this.get('progress') + '%'; }.property('App.events'), proxy: function () { console.log('passing on'); this.sendAction(); }, action: 'hello' }); JS Hosting controller that has hello method Specify action name to be invoked in hosting controller
  • 34. 7. SEND ACTION App.ApplicationController = Ember.Controller.extend({ hello: function () { console.log('hello EmberFest'); } }); App.ProgressBarComponent = Ember.Component.extend({ style: function () { return 'width: ' + this.get('progress') + '%'; }.property('App.events'), proxy: function () { console.log('passing on'); this.sendAction(); }, action: 'hello' }); JS Hosting controller that has hello method Specify action name to be invoked in hosting controller Invoke the specified action
  • 35. TAKEAWAYS ● define template: ‘components/my-comp’ ● use: {{my-comp}} ● parameterize: {{my-comp param=newPar}} ● customize: App.MyCompComponent ● be careful with {{yield}} ● sendAction method (not in guides/API) ● specify ‘action’ property in MyCompComponent