23,969 questions
396
votes
3
answers
163k
views
SPA best practices for authentication and session management
When building SPA style applications using frameworks like Angular, Ember, React, etc. what do people believe to be some best practices for authentication and session management? I can think of a ...
372
votes
18
answers
72k
views
Separate REST JSON API server and client? [closed]
I'm about to create a bunch of web apps from scratch. (See http://50pop.com/code for overview.) I'd like for them to be able to be accessed from many different clients: front-end websites, smartphone ...
261
votes
9
answers
190k
views
Token Authentication vs. Cookies
What is the difference between token authentication and authentication using cookies?
I am trying to implement the Ember Auth Rails Demo but I do not understand the reasons behind using token ...
248
votes
1
answer
56k
views
What are the key differences between Meteor, Ember.js and Backbone.js? [closed]
Learning Ember.js / Backbone.js has been on my to-do list for a while. Now that Meteor is out, I am just wondering if anyone with experience of Meteor, Ember.js and Backbone.js can summarize the key ...
226
votes
6
answers
140k
views
How to implement not with if statement in Ember Handlebars?
I have a statement like this:
{{#if IsValid}}
I want to know how I can use a negative if statement that would look like that:
{{#if not IsValid}}
202
votes
1
answer
3k
views
ember-cli-code-coverage mocha showing 0% coverage when there are tests
I'm using ember-cli-code-coverage with ember-cli-mocha.
When I run COVERAGE=true ember test I'm getting 0% coverage for statements, functions, and lines.
Yet, I have tests that are covering those ...
143
votes
3
answers
22k
views
Views vs Components in Ember.js
I am learning ember.js, and I am trying to understand the difference between a view and a component. I see both as a way of making reusable components.
From Ember's website on views:
Views in ...
114
votes
1
answer
19k
views
What is the difference between a route and resource in New Router API?
I am trying to understand the difference between a Route and a Resource. The way I understand Resource helps to set sub paths of a Route object to another Route Object. But its unclear when i think of ...
105
votes
16
answers
201k
views
Iframe in Chrome error: Failed to read 'localStorage' from 'Window': Access denied for this document
I have a web app which uses localStorage. Now we want to embed this web app on other (third-party) sites via iframe. We want to provide an iframe embed similar to youtube so that other websites can ...
102
votes
10
answers
23k
views
How to architect an Ember.js application [closed]
It's been difficult to keep up with the evolution of Ember JS as its approached (and reached!) version 1.0.0. Tutorials and documentation have come and gone, leading to a lot of confusion about best ...
98
votes
3
answers
30k
views
Ember.js or Backbone.js for Restful backend [closed]
I already know that ember.js is a more heavy weight approach in contrast to backbone.js. I read a lot of articles about both.
I am asking myself, which framework works easier as frontend for a rails ...
97
votes
1
answer
14k
views
What is Ember RunLoop and how does it work?
I am trying to understand how Ember RunLoop works and what makes it tick. I have looked at the documentation, but still have many questions about it. I am interested in understanding better how ...
95
votes
9
answers
64k
views
How can I execute array of promises in sequential order?
I have an array of promises that need to run in sequential order.
var promises = [promise1, promise2, ..., promiseN];
Calling RSVP.all will execute them in parallel:
RSVP.all(promises).then(...);
...
86
votes
8
answers
31k
views
How to use multiple models with a single route in EmberJS / Ember Data?
From reading the docs, it looks like you have to (or should) assign a model to a route like so:
App.PostRoute = Ember.Route.extend({
model: function() {
return App.Post.find();
}
});
...
80
votes
9
answers
47k
views
Recommended way to include bootstrap library in Ember.JS ember-cli App
I am trying to install properly Twitter Bootstrap in my current ember-cli project.
I did install bootstrap with bower :
bower install --save bootstrap
Now the library is downloded in /vendor/...
79
votes
8
answers
33k
views
How do I add a separator between elements in an {{#each}} loop except after the last element?
I have a Handlebars template where I'm trying to generate a comma-separated list of items from an array.
In my Handlebars template:
{{#each list}}
{{name}} {{status}},
{{/each}}
I want the , to ...
76
votes
6
answers
26k
views
EmberJS: How to load multiple models on the same route?
While I am not new to web development, I am quite new to to client-side MVC frameworks. I did some research and decided to give it a go with EmberJS. I went through the TodoMVC guide and it made sense ...
68
votes
13
answers
45k
views
npm install fails in jenkins pipeline in docker
I'm following a tutorial about Jenkins pipeline and I can get a "hello world" working under at node 6.10 docker container.
But, when I added a default EmberJS app (using ember init) to the repo and ...
62
votes
2
answers
15k
views
How and when to use Ember.Application register and inject methods?
I'm trying to understand how to use Ember.Application register & inject methods
What use case are these functions designed for?
How are they to be used and when?
I'd really like to know!
60
votes
2
answers
38k
views
Violating Content Security Policy directive after ember-cli 0.0.47 upgrade
I upgraded my ember-cli app to 0.0.47 and am now getting a bunch of errors in my browser console related to the content security policy. How do I fix this issue?
Refused to load the script 'http://...
60
votes
2
answers
1k
views
Ember js - Hasmany relationships breaks after updating other tables
I am using Ember.js with local-storage-adapter. I have a weird problem while updating records.
I have a post and comments model with hasMany relationships:
App.Post = DS.Model.extend({
title: ...
56
votes
1
answer
9k
views
Getting "Uncaught Error: Assertion Failed: Ember Views require jQuery between 1.7 and 2.1" with app created through ember-cli
I'm starting with ember. I followed the Getting Started guide at emberjs.com and managed to create a new ember application by running the following commands:
npm install -g ember-cli
ember new sample-...
56
votes
4
answers
16k
views
ember.js + handlebars: render vs outlet vs partial vs view vs control
There are scattered explainations of each around, but I'm still not 100% clear on the differences & usage. Could someone give me a side-by-side comparison?
{{outlet}}
{{outlet NAME}}
{{render}}
{...
55
votes
4
answers
18k
views
infinite scroll with ember.js (lazy loading)
I have a view where there can be a large number of items for the user to scroll through and I'd like to implement infinite scrolling to enable progressive loading of the content.
It looks like ...
54
votes
5
answers
86k
views
Check for a value equals to in Ember Handlebar If block helper
How do we check for a value equality in ember.js's If-block helper?
{{#if person=="John"}}
How do we perform above in handlebars?
54
votes
3
answers
23k
views
Add class to ember link-to
I try to build a link to a nested route and want to add a class to this link (for twitter bootstrap)
The result should something like this:
< a href="/#/rents/42" class="btn btn-primary btn-small"...
54
votes
1
answer
942
views
Ember CLI testing complicated model relationships
As far as I can see, when testing ember-data models in ember CLI, all relationships have to be listed in needs. This is fine if the structure is simple, but in many cases there will be multiple ...
53
votes
2
answers
3k
views
Ember.js: Reloading a .hasMany relationship given through "links" in payload
Say I have two models, Topic and Post:
App.Topic = DS.Model.extend({
posts: DS.hasMany('post', { async: true, inverse: 'post' });
});
App.Post = DS.Model.extend({
topic: DS.belongsTo('topic', { ...
51
votes
15
answers
25k
views
emberjs - how to mark active menu item using router infrastructure
I'm trying to create navigation tabs (taken from Twitter Bootstrap):
<ul class="nav nav-tabs">
<li class="active"><a href="#">Home</a></li>
<li><a href="...
51
votes
1
answer
25k
views
EmberJS actions - call one action from another when wrapped within `actions`
How do you call one action from another action when wrapped within actions in an EmberJS controller?
Original code that uses the now deprecated way to define actions:
//app.js
App.IndexController = ...
50
votes
5
answers
36k
views
Accessing Index in #each in emberjs
Please check out the code attached:
http://jsbin.com/atuBaXE/2/
I am trying to access the index using {{@index}} but it seems not to be compiling. I think handlebars supports that:
{{#each item in ...
49
votes
7
answers
26k
views
Access store from component
i have a component and when user click on component it add some value to store,i try to use this way but i get an error :
OlapApp.MeasureListItemComponent = Ember.Component.extend({
tagName: 'li',
...
48
votes
5
answers
18k
views
Ember authentication best practices?
Does anyone have experience creating an authentication mechanism with the new router in pre4?
Here are some of my thoughts so far:
In order to completely separate the view (Ember app) from the ...
48
votes
2
answers
7k
views
What is the complete list of expected JSON responses for DS.RESTAdapter?
I am attempting to write a custom express.js based server for an Ember.js app. I am getting along fairly well but I'm constantly getting stuck trying to guess what JSON responses Ember Data is ...
47
votes
5
answers
14k
views
How to handle 'no route matched' in Ember.js and show 404 page?
How can I handle the error
Uncaught Error: No route matched the URL '...'
and show a custom 404 page?
Note: This question was asked before and answered several months ago - but does not work anymore.
45
votes
2
answers
15k
views
Differences between Sproutcore and Ember
I had selected sproutcore as a framework right before Ember forked from sproutcore. I am left uncertain of which way to go and a bit frustrated in the apparent dilution of efforts caused by the ...
45
votes
3
answers
42k
views
JWT Token strategy for frontend and backend
I'm writing an application with a front end in emberjs and backend/server-side in a nodejs server. I have emberjs configured so that a user can login/signup with an 3rd party Oauth (google, twitter, ...
44
votes
3
answers
22k
views
Ember.js multiple, named outlet usage
I have an application, which will have a view layer organized in three parts:
Sidebar
Toolbar-left
Toolbar-right
I have spent may last few hours with trying to find something helpful with google, but ...
44
votes
4
answers
23k
views
Uncaught Error: Assertion Failed: calling set on destroyed object
working in ember-cli testing. After all tests passed it returns extra two test with errors.
Uncaught Error: Assertion Failed: calling set on destroyed object
Source : '../dist/assets/vendor.js:...
43
votes
5
answers
18k
views
Using Ember.js, how do I run some JS after a view is rendered?
How do I run a function after an Ember View is inserted into the DOM?
Here's my use-case: I'd like to use jQuery UI sortable to allow sorting.
42
votes
4
answers
22k
views
ember.js and the server
I'm looking at Ember.js and have been reading the docs to try and understand how to use it. I get it (pretty well), except for one thing. To my way of thinking in the MVC pattern, the Model is the ...
42
votes
4
answers
12k
views
How should errors be handled when using the Ember.js Data RESTAdapter?
ember-data.js: https://github.com/emberjs/data/tree/0396411e39df96c8506de3182c81414c1d0eb981
In short, when there is an error, I want to display error messages in the view, and then the user can 1) ...
41
votes
3
answers
19k
views
Show property which includes html tags
I've an ember property which includes html tags (<br />, <strong>, <p>, <span>, and similar stuff).
How can i tell ember not to escape this text? Is there any default ...
41
votes
3
answers
7k
views
Caching remote data in Local Storage with EmberData
I have a question about loading and caching remote objects with Ember. I'm developing an Ember app that uses server-side storage through a REST API. Some of the fetched data is rarely changing, so ...
40
votes
10
answers
21k
views
Assigning 'active' class to selected list item in EmberJS
I have a list and I'd like to set one item as class="active" automatically. Given the following bootstrap code:
<ul class="nav">
<li {{bindAttr class="atIndex:active"}}>{{#linkTo "index"}...
40
votes
1
answer
2k
views
How to use jsTree plugin within Ember
I have used jsTree plugin to render large number of tree node in my product.
Now I am in the process of moving to Ember, and need to implement jsTree plugin within Ember.
I wrote a Ember component ...
39
votes
5
answers
19k
views
Inspect Ember.js: Get the type of an object (Class)?
I use console.log() a lot, especially in combination with Ember.inspect(). But there's one thing I miss:
How can I find out the type of an object (Class)?
For example: Getting something like <...
39
votes
5
answers
36k
views
Trigger an action on the change event with Ember.js checkbox input helper?
How can I fire a named action upon changing a checkbox in Ember.js? Any help will be greatly appreciated.
Here is what I have. Checking or unchecking the checkbox has no effect.
Template:
{{input ...
38
votes
2
answers
18k
views
How to access a parent model within a nested index route using ember.js?
I have the following route structure
App.Router.map(function(match) {
this.route("days", { path: "/" });
this.resource("day", { path: "/:day_id" }, function() {
this.resource("...
37
votes
4
answers
43k
views
npm install without symlinks option not working
I setup a development environment with Windows 8 and Ubuntu as a virtual machine. For that I use VirtualBox.
I also manage to create a shared folder in VirtualBox.
In this shared folder I try to ...