ember.js + handlebars: render vs outlet vs partial vs view vs control

They are all template helpers with the following main characteristics as described in emberjs guides. (http://emberjs.com/guides/templates/rendering-with-helpers/) 1.{{outlet}} – Renders a template based on the route determined by the router. Based on the route the corresponding controller and view are used. This is useful when rendering contents based on the route, which is the most common … Read more

how can I invoke an ember component dynamically via a variable?

I tried this and it seems to work, but its just a lot of guesswork on my part: Ember.Handlebars.registerHelper(‘renderComponent’, function(componentPath, options) { var component = Ember.Handlebars.get(this, componentPath, options), helper = Ember.Handlebars.resolveHelper(options.data.view.container, component); helper.call(this, options); }); and you use it the same way: {{#each widget in widgets}} {{renderComponent widget.componentClass widget=widget}} {{/each}}

Ember pagination full example

The updated example below works with ember.js RC1 — 03/14/2013 First you need to add a pagination like mixin as one doesn’t yet exist in the ember core var get = Ember.get, set = Ember.set; Ember.PaginationMixin = Ember.Mixin.create({ pages: function() { var availablePages = this.get(‘availablePages’), pages = [], page; for (i = 0; i < … Read more

Ember.js and RequireJS

EDIT (2012-01-30): I pushed a more complete example in a repo on bitbucket. I have successfully used RequireJS to load Ember.js as well as the datetime addon (github). The Ember namespace itself stays global, but all of my application’s data, including my instance of Ember.Application, is kept within modules through RequireJS. I’m also loading the … Read more

Recommended way to include bootstrap library in Ember.JS ember-cli App

BASH: bower install –save bootstrap Brocfile.js: app.import(‘vendor/bootstrap/dist/js/bootstrap.js’); app.import(‘vendor/bootstrap/dist/css/bootstrap.css’); The JS will be added to the app.js, which is linked by default, and the CSS will be added to assets/vendor.css, which as of May 14th, is also added by default. For reference: http://www.ember-cli.com/#managing-dependencies In response to @Joe’s question surrounding fonts and other assets, I was unable … Read more