Show Menu

Ember.js Cheat Sheet by

Ember.js cheat sheet made from http://embersherpa.com/cheatsheet/
development     javascript     framework     ember     emberjs

Basics

App.R­ou­ter.ma­p(­f­n)
allows you to add routes and resources to your app
App.a­dv­anc­eRe­adi­nes­s()
call this function when your app is ready to be initia­lized
App.d­ef­erR­ead­ine­ss()
delays initia­liz­ation until advanc­eRe­adiness is called
App.i­nj­ect­(­type, property, inject­ion­)
add a property onto every object of a specific type
Embe­r.A­rra­yCo­ntr­oll­er.e­xt­end( {} )
represents several objects
Embe­r.C­ont­rol­ler.ex­ten­d( {} )
grouping of specific, non object related functi­onality (e.g authen­tic­ation or search)
Embe­r.O­bje­ct.c­re­ate( {} )
create an instance of an object
Embe­r.O­bje­ct.c­re­ate­Wit­hMi­xin­s(­m­ixins, {} )
create an instance of an object with mixins
Embe­r.O­bje­ct.d­es­tro­y()
set isDest­roying to true and schedule removal of all bindings and observing for the end of run loop
Embe­r.O­bje­ct.g­et­(­ke­yNa­me­)
return value of property by given name while respecting computed and observed properties
Embe­r.O­bje­ct.r­eo­pen­Cla­ss( {} )
add methods and properties to a class
Embe­r.O­bje­ct.s­et­(­ke­yName, value­)
set the value of property while respecting computed proper­ties, unknown proper­ties, property observers and chaining
Embe­r.O­bje­ctC­ont­rol­ler.ex­ten­d( {} )
represents a single object
Embe­r.i­sNo­ne(­­obj­)
Returns true if the passed value is null or undefined.

Ember.A­pp­lic­ati­on.i­ni­tia­lizer

after: 'some­Ini­tia­lizer'
name of the initia­lizer to run before running this initia­lizer
name: 'prel­oad'
name for this initia­lizer
init­ial­ize: funct­ion­(co­nta­iner, applic­ation)
function to execute when an app is initia­lizing
 

Ember.A­pp­lic­ation

Embe­r.A­ppl­ica­tio­n.c­rea­te: ( {
creates an instance that will be your app and your app's namespace
LOG_­ACT­IVE­_GE­NER­ATI­ON: true
activate logging of automa­tically generated routes and contro­llers
LOG_­STA­CKT­RAC­E_O­N_D­EPR­ECA­TION: true
activate logging of deprecated method or property usage
LOG_­TRA­NSI­TIO­NS: true
activate basic logging of successful transi­tions
LOG_­TRA­NSI­TIO­NS_­INT­ERN­AL: true
activate detailed logging of all routing steps
LOG_­VIE­W_L­OOK­UPS: true
activate logging of results of view and template searches by routes
root­Ele­ment
DOM element or jQuery­-co­mpa­tible selector string where your app will be rendered
} );

Ember.R­oute

Embe­r.R­out­e.e­xte­nd: (mixins, {
befo­reM­odel: funct­ion­(tr­ans­ition)
hook executed before resolving models (use for early redire­ction)
acti­vate: function
hooked called when router enters route the first time
afte­rMo­del: funct­ion­(model, transi­tion)
hooked called after models are resolved (use for late redirect)
deac­tiv­ate: function
hook executes when the router completely exits this route
model: funct­ion­(pa­rams)
provides data to be used by the controller and the view
rend­erT­emp­late: funct­ion­(co­ntr­oller, model)
hook to override default template rendered for this route
seri­ali­ze: funct­ion­(mo­del)
converts model into parameters for the url
setu­pCo­ntr­oll­er: funct­ion­(co­ntr­oller, model)
function that can be used to configure the controller
acti­ons
object with properties
acti­ons: { willTr­ans­ition: functi­on(­tra­nsi­tion) }
called whenever transition triggered on current route
acti­ons: { error }
} );
 

Ember.View

Embe­r.V­iew.ex­tend: (mixins, {
attr­ibu­teB­ind­ings: ['dat­aSize', 'href']
array of View's property names used to calculate View's DOM element's attributes
clas­sNa­meB­ind­ings: ['isA­vai­lable', 'color']
array of View's property names used to calculate View's DOM element's class attribute
clas­sNa­mes: ['color', 'size']
array or string of View's class attribute
cont­rol­ler: Ember.Co­ntr­oll­er.c­reate( {} )
instance of descen­dants of the Ember.C­on­troller
defa­ult­Tem­pla­te: Ember.Ha­ndl­eba­rs.c­om­pil­e('...')
compiled Handlebars template used when the view doesn't have the template or templa­teName property specified
even­tMa­nag­er: {}
an object with properties named after events that this view handles and values are functions that process these events
layo­ut: Ember.Ha­ndl­eba­rs.c­om­pil­e('...')
compiled Handlebars template that wraps the view
tagN­ame: 'em'
string HTML tag to be used for View's DOM element
temp­late: Ember.Ha­ndl­eba­rs.c­om­pil­e('...')
compiled Handlebars template used to render this view
temp­lat­eNa­me: 'some­-te­mpl­ate'
string name of the template to be used to render this view (used instead of template)
} );

Ember.O­bject

Embe­r.O­bje­ct.e­xt­end: (mixins, {
init: funct­ion()
method called when an instance of this class is created
} );

Download the Ember.js Cheat Sheet

2 Pages
//media.cheatography.com/storage/thumb/mwore_ember-js.750.jpg

PDF (recommended)

Alternative Downloads

Share This Cheat Sheet!

Like this cheat sheet? Check out our sponsors!

Readable.io is a collection of tools to make your writing better. More readable content means higher conversion rates and better reader engagement. Measure website and document readability, measure keyword density and more!

Click Here To Get Started!

 

Comments

padimas padimas, 17:05 21 Jan 15

thanks for your kindness of sharing this sheet (y)

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Bacon.js Cheat Sheet
          Polymer.js Cheat Sheet
          Selenium WebDriver Cheat Sheet Cheat Sheet