Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
EmberJS Intro
Search
catalin.ion
March 06, 2015
Programming
31
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
EmberJS Intro
catalin.ion
March 06, 2015
Other Decks in Programming
See All in Programming
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
340
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
380
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
210
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
290
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
610
Jetpack Compose Mechanisms
skydoves
3
820
TechTown - Creating Composable Callables in Contemporary C++
rollbear
0
130
Agents on Rails - Rails at Scale 2026
irinanazarova
0
560
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
0
1.2k
sbt 2.0: takeoff
eed3si9n
0
160
Featured
See All Featured
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
4 Signs Your Business is Dying
shpigford
187
23k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
We Have a Design System, Now What?
morganepeng
55
8.4k
Making Projects Easy
brettharned
120
6.8k
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
Transcript
None
WHAT IS EMBER Client-side JavaScript application framework based on the
MVC pattern. • Router • MVC • Components • Convention over configuration
ROUTER • Translates a URL into a series of nested
templates • Manages application state • Keeps the URL up-to-date ROUTE • tells the template which model it should display
// app/router.js var Router = Ember.Router.extend({}); Router.map(function() { this.route('articles'); });
// app/routes/articles.js export default Ember.Route.extend({ model: function () { return this.store.find('article'); } });
MODEL • defines the properties and behavior of the data
• stores persistent state STORE • central repository of records in your application • created for you automatically • shared among all of the objects
// app/models/article.js import DS from 'ember-data'; export default DS.Model.extend({ title:
DS.attr('string'), author: DS.attr('string'), publishedAt: DS.attr('date'), published: DS.attr('boolean') });
CONTROLLER • stores application state • is more of a
ViewModel or Presenter • used to decorate models with display logic ObjectController • wraps a single model ArrayController • wraps an array of models
// app/controllers/article.js export default Ember.ObjectController.extend({}); export default Ember.ArrayController.extend({});
TEMPLATES • Describes the user interface • Backed by a
model • Used to be written in Handlebars • As of 1.10 HTMLBars is used CAN CONTAIN • HTML • Expressions {{title}} • Outlets - placeholders for other templates • Components
{{! app/templates/article.hbs }} <div class="article"> <h1>{{title}}</h1> {{#if date}} <span class="date">{{date}}</span>
{{/if}} {{body}} </div>
COMPONENTS • custom HTML tag • behavior implemented using JavaScript
• interface described using HTMLBars • you can pass data to components • wrap content in a component • components can send action to your app
// app/components/collapsible.js export default Ember.Component.extend({ tagName: 'collapsible', actions: { toggle:
function () { this.toggleProperty('isExpanded'); } } }); {{! app/templates/components/collpsible-widget.hbs }} <div> <a {{action "toggle"}} > {{title}}</a> </div> {{#if isExpanded}} {{yield}} {{/if}}
{{! app/templates/index.hbs }} {{#collapsible-widget title="Some title"}} <h1>This content will show/hive<h1>
{{/collapsible-widget}}
EMBER INSPECTOR
EMBER-CLI • Command line utility • Scaffolding a new app
• Generators • Assets Compilation • ES6 Modules • Testings • Preconfigured to use QUnit • Addons
RESOURCES • http://emberjs.com/guides • http://www.ember-cli.com • http://emberweekly.com/