How should errors be handled when using the Ember.js Data RESTAdapter?

This weekend I was trying to figure the same thing out. Going off what Luke said, I took a closer look at the ember-data source for the latest commit (Dec 11). TLDR; to handle ember-data update/create errors, simply define becameError() and becameInvalid(errors) on your DS.Model instance. The cascade triggered by the RESTadapter’s AJAX error callback … Read more

ember.js and the server

Digging just a bit around emberjs on GitHub I have found this: https://github.com/emberjs/data: Ember Data is a library for loading models from a persistence layer (such as a JSON API), updating those models, then saving the changes. It provides many of the facilities you’d find in server-side ORMs like ActiveRecord, but is designed specifically for … Read more

Using Ember.js, how do I run some JS after a view is rendered?

You need to override didInsertElement as it’s “Called when the element of the view has been inserted into the DOM. Override this function to do any set up that requires an element in the document body.” Inside the didInsertElement callback, you can use this.$() to get a jQuery object for the view’s element. Reference: https://github.com/emberjs/ember.js/blob/master/packages/ember-views/lib/views/view.js

JWT Token strategy for frontend and backend

If we’re talking about not only working but also secure stateless authentication you will need to consider proper strategy with both access and refresh tokens. Access token is a token which provides an access to a protected resource. Expiration here might be installed approximately in ~1 hour (depends on your considerations). Refresh token is a … Read more

Ember.js multiple, named outlet usage

With the new Router you can do something like this: {{outlet “menu”}} {{outlet}} In your Route you can handle the content of the outlets: // application route Ember.Route.extend({ renderTemplate: function() { // Render default outlet this.render(); // render extra outlets this.render(“menu”, { outlet: “menu”, into: “application” // important when using at root level }); } … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)