SlideShare a Scribd company logo
Ember Components
Ember's implementation of components hews as closely to
the Web Components specification as possible.
Web component is a reusable
components By encapsulating html and
javascript.
Add Action:
Action can be added to any dom
element
<div class="bar" {{action
"hello"}}>
Define component template:
app/templates/components/blog
-post.hbs
<article class="blog-post">
<h1>{{title}}</h1>
<p>{{yield}}</p>
<p>Edit title: {{input
type="text" value=title}}</p>
</article>
Using component
Action can be added to any dom
element
{{blog-post}}
Passing Parameters:
We can pass parameters to the
component.
{{blog-post title=title}}
Pod Style Components
Pod style for components can be
used to implemented for
improved abstraction.
Ember Addons http://www.emberaddons.com/
Create an ember Addon
addons can be easily created
using ember-cli
ember addon ember-cli-
search-text
Javascript:
Extend the functionality the new component.
addon/components/ember-cli-search-text.js
import Ember from 'ember';
export default Ember.Component.extend({
focus: false,
didInsertElement: function() {
console.log('did insert element invoked');
var thing = this.$('textarea');
console.log(thing);
},
willDestroyElement: function() {
console.log('will destroy invoked');
this.$('textarea').destroy();
},
keyUp: function() {
console.log('keyup invoked');
}
});
HTML
update the template for the new
component.
{{textarea value=content}}
Publish Addon
Addon can be published to the
ember addon simply by npm
publish.
npm version 0.0.1
git push origin master
git push origin --tags
npm publish
Fin

More Related Content

What's hot (20)

PDF
AppSyncをReactで使ってみた
Takahiro Kobaru
 
PPT
Introduction To Asp.Net Ajax
Jeff Blankenburg
 
PPTX
Angular4 getting started
TejinderMakkar
 
PPTX
Angular 4 - quick view
Michael Haberman
 
PPTX
Gradle Play Publisher Plugin
Daniel Kao
 
PDF
TechEvent 2019: Nachhaltige Client-Architekturen mit Angular Elements; Thomas...
Trivadis
 
PPTX
Blazor and Azure Functions - a serverless approach
Alex Pshul
 
PPTX
Creating a custom connector in mule
Achyuta Lakshmi
 
PPTX
Angular2 + New Firebase in Action
Ruben Chavarri
 
PPTX
GAB2017 - Azure function to build serverless SharePoint apps
Riwut Libinuko
 
PPTX
Angular2 + Ng-Lightning + Lightning Design System = Great Apps
Emily Hurn
 
PPT
ASP.NET AJAX Basics
petrov
 
DOCX
Angular2RoutingSetupByShubham
Shubham Verma
 
PDF
SocketIOSetupWithAngularJSAppByShubham
Shubham Verma
 
PPTX
State in stateless serverless functions
Alex Pshul
 
PDF
Build Android App using GCE & GAE
Love Sharma
 
PPTX
Android App Bundles - Overview
Syed Awais Mazhar Bukhari
 
PPTX
TypeScript and SharePoint Framework
Bob German
 
PPTX
Github plugin setup in anypointstudio
Rajkattamuri
 
PPT
Web Os Hands On
360|Conferences
 
AppSyncをReactで使ってみた
Takahiro Kobaru
 
Introduction To Asp.Net Ajax
Jeff Blankenburg
 
Angular4 getting started
TejinderMakkar
 
Angular 4 - quick view
Michael Haberman
 
Gradle Play Publisher Plugin
Daniel Kao
 
TechEvent 2019: Nachhaltige Client-Architekturen mit Angular Elements; Thomas...
Trivadis
 
Blazor and Azure Functions - a serverless approach
Alex Pshul
 
Creating a custom connector in mule
Achyuta Lakshmi
 
Angular2 + New Firebase in Action
Ruben Chavarri
 
GAB2017 - Azure function to build serverless SharePoint apps
Riwut Libinuko
 
Angular2 + Ng-Lightning + Lightning Design System = Great Apps
Emily Hurn
 
ASP.NET AJAX Basics
petrov
 
Angular2RoutingSetupByShubham
Shubham Verma
 
SocketIOSetupWithAngularJSAppByShubham
Shubham Verma
 
State in stateless serverless functions
Alex Pshul
 
Build Android App using GCE & GAE
Love Sharma
 
Android App Bundles - Overview
Syed Awais Mazhar Bukhari
 
TypeScript and SharePoint Framework
Bob German
 
Github plugin setup in anypointstudio
Rajkattamuri
 
Web Os Hands On
360|Conferences
 

Recently uploaded (20)

PDF
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
PDF
OpenInfra ID 2025 - Are Containers Dying? Rethinking Isolation with MicroVMs.pdf
Muhammad Yuga Nugraha
 
PDF
SalesForce Managed Services Benefits (1).pdf
TechForce Services
 
PPTX
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PPTX
Using Google Data Studio (Looker Studio) to Create Effective and Easy Data Re...
Orage Technologies
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
PDF
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PPTX
Earn Agentblazer Status with Slack Community Patna.pptx
SanjeetMishra29
 
PDF
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
PPTX
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
OpenInfra ID 2025 - Are Containers Dying? Rethinking Isolation with MicroVMs.pdf
Muhammad Yuga Nugraha
 
SalesForce Managed Services Benefits (1).pdf
TechForce Services
 
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
Using Google Data Studio (Looker Studio) to Create Effective and Easy Data Re...
Orage Technologies
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
The Future of Artificial Intelligence (AI)
Mukul
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Earn Agentblazer Status with Slack Community Patna.pptx
SanjeetMishra29
 
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Ad

Ember components