infinite scroll with ember.js (lazy loading)

I’ve implemented an infinite scroll mechanism at the GitHub Dashboard project, I’m currently developing. The feature is added in commit 68d1728. The basic idea is to have a LoadMoreView which invokes the loadMore method on the controller every time the view is visible on the current viewport. I’m using the jQuery plugin inview for this. … Read more

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

Getting “Uncaught Error: Assertion Failed: Ember Views require jQuery between 1.7 and 2.1” with app created through ember-cli

This is a bug due to a new version of jQuery which ember is not yet able to handle. For now you can change the following line in your bower.json file. Then run bower install and it should work. “jquery”: “^1.11.3”, to “jquery”: “1.11.3”, A new version of ember.js is imminent which should fix this.

Violating Content Security Policy directive after ember-cli 0.0.47 upgrade

After reading some docs at http://content-security-policy.com/ and https://github.com/rwjblue/ember-cli-content-security-policy, I added some policies to my config/environment.js file like so: module.exports = function(environment) { var ENV = { contentSecurityPolicy: { ‘default-src’: “‘none'”, ‘script-src’: “‘self’ ‘unsafe-inline’ ‘unsafe-eval’ use.typekit.net connect.facebook.net maps.googleapis.com maps.gstatic.com”, ‘font-src’: “‘self’ data: use.typekit.net”, ‘connect-src’: “‘self'”, ‘img-src’: “‘self’ www.facebook.com p.typekit.net”, ‘style-src’: “‘self’ ‘unsafe-inline’ use.typekit.net”, ‘frame-src’: “s-static.ak.facebook.com static.ak.facebook.com … Read more

How and when to use Ember.Application register and inject methods?

Ember by default does dependency injection when it boots your application using mostly conventions, for example if you use ember-data then an instance of the store class is injected in every route and controller in your application, so you can later get a reference by simply doing this.get(‘store’) inside any route or controller. For example … Read more

EmberJS: How to load multiple models on the same route?

BEWARE: You want to be careful about whether or not returning multiple models in your model hook is appropriate. Ask yourself this simple question: Does my route load dynamic data based on the url using a slug :id? i.e. this.resource(‘foo’, {path: ‘:id’}); If you answered yes Do not attempt to load multiple models from the … Read more