Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ember first steps and core concepts

Ember first steps and core concepts

Gastón Iván

July 26, 2015
Tweet

More Decks by Gastón Iván

Other Decks in Programming

Transcript

  1. Minimal Ember app App = Ember.Application.create(); It already has: •

    Application route • Index route http://emberjs.jsbin.com/leyura/1/edit? html,js,output
  2. Typical Ember app flow • The router resolves a route

    to an Ember. Route • The route passes a model to the controller. • The controller renders a template. http://emberjs.jsbin.com/kaqete/edit?html, js,output
  3. Data Down & Events Up Data down: route -> controller

    -> template view -> Events up: template -> controller -> route -> view -> controller -> route
  4. Events • By default go to the controller • Bubble

    up only if the event returns a truthy value. • View events don’t propagate to the controller. http://emberjs.jsbin.com/jiseve/1/edit?html, js,console,output
  5. Ember components Controllers and Views are deprecated, use components. •

    It has no context, must be passed. • Events don’t go up (no bubble up)
  6. Its a view Ember components have all the features of

    an Ember.View. var Component = View.extend(... (Ember source code)