Assigning ‘active’ class to selected list item in EmberJS
{{#link-to “dashboard” tagName=”li” href=false}} <a {{bind-attr href=”https://stackoverflow.com/questions/14412073/view.href”}}> Dashboard </a> {{/link-to}}
{{#link-to “dashboard” tagName=”li” href=false}} <a {{bind-attr href=”https://stackoverflow.com/questions/14412073/view.href”}}> Dashboard </a> {{/link-to}}
Just to “bump” this thread up a little, because it was one of the top results when I researched solutions for ember local cache of restful api, etc.: Dan Gebhardt seems to do a bloody good job with Orbit.js and its integration into Ember: https://github.com/orbitjs/ember-orbit Orbit is a standalone library for coordinating access to data … Read more
From http://handlebarsjs.com/ Handlebars HTML-escapes values returned by a {{expression}}. If you don’t want Handlebars to escape a value, use the “triple-stash”. {{{expression}}}
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
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
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
This is either because in the result of a promise or any other deferred code you do not check the destroy status of an object, or because you didn’t teardown something that has been setup and interact with DOM events or anything external to the core of Ember. I used to have this especially on … Read more
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
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
As someone who has both a Sproutcore app and an Ember app close to a production launch, I’ll take a stab at your questions (re-ordered for clarity). All of the below is what I’ve observed with no inside knowledge. A bit of it is speculation, so I’ve enabled wiki mode on this answer, so that … Read more