FAQ Database Discussion Community


how to add event for drop-down component to change subdomain by selected item

ember.js,express,ember-data,subdomain,ember-cli
i use pod structure with ember cli. i have a 'drop-down' component. in my drop-down.js component: import Ember from 'ember'; var component = Ember.Component.extend({ tagName: '', //remove extra div wrapper. valueKey: 'id', textKey: 'text', options: [], value: null, defaultText: 'select...', selected: function () { var valueKey = this.get('valueKey'); var textKey...

ember-cli scss lint addon not performing task

ember.js,ember-cli,broccolijs
I am trying to make a SCSS lint addon for ember-cli (I know one exists already ember-cli-scsslint but I want one more customisable). I was wondering whether anyone has had experience using broccoli-scss-lint because I am having trouble feeding in my styling tree and having scss-lint actually lint my files....

How can I declare globals for jshint to ignore in ember-cli?

ember.js,ember-cli,jshint,sinon
I'm using sinon in my specs and including it in the Brocfile as describe in the ember-cli docs. This works and I can use sinon in my specs. But, jshint is complaining that sinon is not defined: 1 error: expected false to be truthy AssertionError: unit/views/edit-todo-test.js should pass jshint. unit/views/edit-todo-test.js:...

Ember JS - Handlebars template - @index being undefined inside #each

javascript,templates,ember.js,ember-cli,handlebars
I looked for a duplicate question but couldn't find one on SO. Hence here it goes. I have an #each block in my template which is successfully printing the values from an array but when I try to get the current index using @index within that block like this -...

Ember Routing Model Observing Updates in Handlebars Template

ember.js,ember-data,ember-cli
How do I update a model property once a promise (via Ajax call) has returned? Here is my go at it that is not working. In the docs, it appears observing takes place using Ember.set but the model I am returning is not an Ember model object so I don't...

Ember-cli 0.2.5 livereload keeps reloading in every change

ember-cli
After updating to ember-cli 0.2.5 (same think with 0.2.4; 0.2.3 was ok), when i make a change to a file and save it, it keeps reloading my app at least 3 times for each save i do. Server's console shows file added... file added... file added... for all my app...

Emberjs toggle effect of dynamic data

javascript,ember.js,ember-cli
I have a table loaded with dynamic data from an api. The <td></td> displays a company name and when clicked I want a div that has the companies information to be displayed. I saw a few examples and this is what I did: Here is my handlebars: {{#each m in...

Ember 1.12 deprecation warning about The `initializer` API

ember.js,ember-cli
I'm upgrading an ember/ember-cli application to ember 1.12. I'm now receiving the following deprecation warning: DEPRECATION: `lookup` was called on a Registry. The `initializer` API no longer receives a container, and you should use an `instanceInitializer` to look up objects from the container. See http://emberjs.com/guides/deprecations#toc_deprecate-access-to-instances-in-initializers for more details. Looking at...

Ember CLI with Pods

ember.js,ember-cli,ember-pods
I've been trying to move my Ember app across to use pods in preparation of 2.0. I moved all the files, set the environment.js paramters and now my app shows nothing but the empty index.html. What have I done wrong? I've attached screenshots of my setup. UPDATE: So as Kyle...

In Ember 1.13 and later what key should I use with each when iterating over an array of strings?

ember.js,ember-cli
In Ember 1.13 the following code generates a warning: {{#each widgetNames as |widgetName|}} {{component widgetName removeWidget="removeWidget"}} {{/each}} Where widgetNames is an array of strings in a parent controller. widgetNames: [] In Ember 1.13 I now get this warning: WARNING: Using {{each}} without specifying a key can lead to unusual behavior....

NPM repo missing file

ember.js,npm,ember-cli
I have a git repo for an Ember Addon: https://github.com/lifegadget/ui-responsive-toolbelt It passes all unit tests. It has been published to npm as ui-responsive-toolbelt. I have used npm's "link" functionality to test locally that this "addon" (in Ember parlance) works fine in consuming application when included in the package.json file as...

Ember Data “modelFor” error when serializing models

ember.js,ember-data,ember-cli
I am using ember 1.13, ember-cli and ember data 1.19.1 and I am experiencing an error that is difficult to track down due to being unspecific. The error occurs when I do the following: this.get('model').forEach(function(mymodel) { applications.push(elavonApplication.serialize({includeId: true})); }); where "elavonApplication" is an instance of a DS.Model called "elavon-application" and...

Ember library causing “Binding Style Attributes” deprecation warning

javascript,ember.js,ember-cli,filepicker
I'm trying to use the ember-cli-file-picker to load a file into my app for processing in the browser. It works but raises the following deprecation error WARNING: Binding style attributes may introduce cross-site scripting vulnerabilities; please ensure that values being bound are properly escaped. For more information, including how to...

giving an input a dynamic value emeberjs

javascript,ember.js,ember-cli
So I have an each loop that iterates over an ember model: {{#each model.product.variants as |variant|}} {{input type="radio" value=variant.id name="product_id" action="radioChecked" on="focus-in"}} {{/each}} What im trying to do is set the value of each input to the id of the variant, this part right here value=variant.id. now this seems like...

Ember CLI with Multiple Proxies

proxy,ember-cli
The Problem: I have an Ember CLI Application that will consume multiple APIs, which I need to proxy to in development mode. Background: I have a legacy api which exposes services at /api running on my local development machine at localhost:3000 I have a new api which exposes services at...

Exclude folders from builds in Brocfile

javascript,ember.js,ember-cli,broccolijs
Is there a way to exclude a folder from a build in a Brocfile (or any other place). The use case is packaging, where I have an app made of sub-apps within pods. eg. /app/modules/components /app/modules/app1 /app/modules/app2 /app/modules/app3 I'd like to build them all when environment is set to 'development'...

changing the value of a model property emberjs

javascript,ember.js,ember-cli
I'm trying to achive a toggle effect in Emberjs for some dynamically loaded data. Here is my adapter: export default Ember.Object.extend({ findAll: function(){ return ajax('http://localhost:8000/api/v1/address-book/companies?includes=details') .then(function(response){ return response.data.map(function(c){ return { name: c.name, website: c.details.data.website_url, dev_website: c.details.data.development_website_url, showDetails: false }; }); }); } }); Here is the HTML handlebars: {{#each m...

When creating a new data object in Ember that relies on another object how do you pass it along?

ember.js,ember-cli
I am on a page where I can see a specific customer, part of my router.js is: this.route('customers'); this.route('customer', {path: "customers/:customer_id"}); this.route('customer.order.create', { path: "customers/:customer_id/order/create" }); customer.order.create needs to load in my main view and so is not nested. An order 'has a' customer. I've setup my /customer/order/create controller to...

How to get the clicked element on Ember Component

ember.js,ember-cli
I'm learning EmberJS, I tried to search the docs and stuff but I couldn't get it right so far I've implemented the component and a action to respond on click event, for now it just print something in the console. I want to get the clicked element so I could...

Ember.js: Which controller is in charge?

ember.js,ember-cli
What I've got ember-cli POD structure. I've got nested routes and so the following folder-structure: | |_pods |_items |_index | |_controller.js | |_route.js | |_template.hbs |_item |_controller.js I'm loading all the item-records of my model in the model-hook of items/index/route.js. In my index-template, I'm iterating over all items from the...

Ember passing a model to transitionToRoute

ember.js,ember-cli,ember-router,ember-controllers
I'm using Ember-cli with ember 1.11 I'm trying to use the transitionToRoute method in a controller to transition to a route and feed it a dynamically generated object as the model. Here's my controller: import Ember from 'ember'; export default Ember.Controller.extend({ actions: { launch_scanner: function(){ console.log('launch_scanner'); var model = {name:...

Ember - Nothing handled the action occurs

ember.js,ember-data,handlebars.js,ember-cli,handlebars
Nothing handled the action error occurs for the following code. How to resolve this? I have created a view, an object for my sample app using ember. But the action part is not working. How to bind an action to a view? HTML: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Ember...

Rendering dynamically generated {{link-to}} links in an Ember.js Handlebar template expression

javascript,ember.js,ember-cli,handlebars
I have an Ember template that is rendering text with a Handlebar expression, i.e. {{caption}}. The text being rendered has hashtags in it, each of which I need to make clickable, and going to a specific route in the Ember app. I created a helper to parse the text and...

emberjs with laraval pagination

laravel,ember-data,ember-cli
I am beginner with emberjs. I am trying to load a paginated data, so far able to load the whole records. Now not sure how to load the laraval paginated data, as when i send call without pagination i get response like { 'users':[{ 'id':1, 'name':'Aamir' },{ 'id':2, 'name':'Jamshed' }]...

Ember CLI generated unit test is failing on it exists

javascript,unit-testing,ember.js,ember-cli,ember-qunit
I have an order controller in controllers/order.js import Ember from 'ember'; export default Ember.Controller.extend({ needs: "orders" }); This has a test in /tests/unit/controllers/order-test.js import { moduleFor, test } from 'ember-qunit'; moduleFor('controller:order', { // Specify the other units that are required for this test. // needs: ['controller:foo'] }); // Replace this...

How can I fix tests in Ember testem with errors such as 'could not load', 'failed', 'could not find module' or 'died'?

ember-cli,testem,karma-coverage
I managed to get a couple of EAK/grunt based Ember apps upgraded to 1.11 with HTMLBars, and then got them migrated to Ember CLI/Brocolli. The unit tests were setup for karma test runner so I'm looking at how to get those running in the CLI projects now, but I didn't...

Override Ember application.hbs template

javascript,ember.js,handlebars.js,ember-cli,handlebars
I have an Ember JS application with 99% of it's resources on the root level, which the user has to be logged in to access. All those resources, with the exception of /login, have the same template. /login, however, has an entirely different template (no nav bar, etc). What's the...

Activating Feature Flags with Ember CLI

ember.js,ember-cli
I was reading the documentation here, and it looks like I should be able to activate feature flags like this in my config/environment.js file: var ENV = { EmberENV: { FEATURES: { 'new-computed-syntax': true, 'ember-htmlbars-component-generation': true } } } Yet this doesn't seem to be enough, even after restarting ember...

How to accept model collection metadata, such as count in ember?

ember-data,ember-cli
In Ember-CLI, how does one go about retrieving/storing model collection metadata? For example, suppose I have a model 'user' with some defined attributes, and my route retrieves a collection of users with ember-data like so: model: function(params) { return this.store.findQuery('user', params); } }); and the JSON response from my API...

One passing Ember integration test breaks the next one: bad teardown block?

ember.js,ember-cli,ember-qunit
I have these two Ember integration tests, A and B. (I have a lot more, but in debugging this I have literally removed every other test in order to isolate the problem. There are 9 tests in the same file as A and I commented the other 8.) If A...

Ember: Access ember data 'store' object from utility class

javascript,ember.js,ember-data,ember-cli
I have a utility class for validating usernames in my ember application and have it setup as specified in the ember-cli docs. I do client-side username validation in several places in my application (components and controllers) so I wanted to pull the validation logic out into a reusable method. The...

Fetching API data from Ember Controller

ember.js,ember-data,ember-cli
I am an Ember newbie and am trying to create a simple application to fetch records from an API server. Currently I am trying to query the this.store.find('validemail',{'email':'abc.gmail.com'}).then(function(response){ console.log(response); }); //Console log on browser Class {query: Object, store: Class, manager: Class, isLoaded: true, meta: Object…}__ember1434866946710: "ember592"__ember_meta__: Object__nextSuper: undefinedcontent: (...)get content:...

How to fix 'Microsoft' is not defined in Ember CLI Bing Map?

ember.js,ember-cli,bing-maps-api
In an Ember CLI project, I managed to get the old 'bing-maps-element' working as a Component, but jshint and unit tests complain that "'Microsoft' is not defined". The Microsoft object is a global loaded by a 'veapicore' script (Virtual Earth API) after after the Ember Component tries to reference it,...

How do you create a Handlebars block helper in Ember that can wrap/manipulate content?

javascript,ember.js,handlebars.js,ember-cli
I want to create a Handlebars block helper (to use in an Ember app) that wraps and escapes content. I thought it would be relatively simple, but I've spent hours on it and gotten nowhere. I want this: {{#code}} <p>Hey!</p> {{/code}} To become this: <pre> <code> &lt;p&gt;Hey!&lt;/p&gt; </code> </pre> The...

Ember-cli: New project without Handlebars

javascript,ember.js,ember-cli
I am creating a new project by issuing the following command: ember new todomvc The problem is that the new project does not have HandleBars loaded. This is what I see in the console: ember.debug.js:4888 DEBUG: Ember : 1.12.0 ember.debug.js:4888 DEBUG: Ember Data : 1.0.0-beta.17 ember.debug.js:4888 DEBUG: jQuery : 1.11.3...

Ember Validations stopped working after updating to [email protected]

ember.js,ember-cli
import EmberValidations from 'ember-validations'; After updating to [email protected], I am no getting the following error for the statement above: Could not find module `ember-validations` imported by ... It seems like it can`t find the import at all, any Ideas why?...

Ember-cli non ember function

ember-cli
I already worked with emberjs before it used ember-cli but now I am not sure how I can do that. I need to create some functions to manage my cookies and some other thing, but I don't know where I should put them in the project so they will be...

How to not always compile all assets on autoload in ember.js

ember.js,ember-cli,broccolijs
I've started my first ember.js project with ember-cli including ember-cli-broccoli-compass to compile my stylesheets with compass. Now that I've done my first styling, my stylesheets need 5 seconds to compile. When I now work on my javascripts and there are any changes to my files, my whole project, including the...

How to run action in Ember Controller afterRender

ember.js,ember-data,ember-cli
im new to ember framework. I just want to execute a function that defined inside the actions hook when the rendering completes. var Controller = Ember.Controller.extend({ actions: { foo: function() { console.log("foo"); } } }); Ember.run.schedule("afterRender",this,function() { this.send("foo"); } but the above code not working. I just want to know...

Ember-CLI Route model data not affecting template

javascript,ember.js,ember-cli,handlebars
I have an ember route webtest contained within the file routes/webtest.js: export default Ember.Route.extend({ model: function() { return { title: "Does not appear" }; } }); I have the matching template contained within templates/webtest.hbs <div class="container"> <h2>Title: {{title}}</h2> </div> when I navigate to the page /webtest in my web browser...

Create a record from related “belongs to” route. Assertion failed: Assertion Failed: You can only add a 'group' record to this relationship

ember.js,ember-data,ember-cli
I'm trying to create a new "student" from within the "group" route. The "student" belongs to the group. True to form, as soon as you want to do anything different to the very straightforward examples, things become a total mystery - I'd appreciate some help! "Students" belong to a "Group"....

Ember-cli resolver

javascript,ember.js,ember-cli
I have an ember-cli project, and I want to create settings.js file placed in "app" folder, this is it: export default { urls: { "companiesDepartmentsUrl": '/api/meta/get-departments', "savePartnersUrl": "/api/partners/save", "checkObjectId": "/api/objects/check-id", "objectsUrl": "/api/objects/find" } }; Then in my view that is called "objects" (app/view/objects.js) I try to import it this way:...

How to dynamically apply classes to objects in ember-cli?

ember.js,ember-cli
I'm creating an app that has a listing of items and a series of filter buttons at the top. As the user applies different filters, I want the buttons to change style using CSS classes to show them as enabled/disabled. I want to be able to write something like the...

configuring server and client ports in Ember-Cli

ember.js,ember-data,ember-cli
I am making an Ember app using Ember-Cli which talks to a server side application. Because Ember-Cli projects run with their own server (on port 4200 by default), I have to run my server in development on a different port (localhost:8080) than the Ember app. In production, however, the two...

Optimizing emberjs filter search

javascript,ember.js,ember-cli
I have a simple search input that filters through an api response that is represented in a html table. Filtering works very well but for some reasons I feel like it was a very ugly way to go by it. So I', wondering what would be a better way to...

How to add a custom row for adding data to ember-table?

ember-cli,ember-table
I would like to add a custom row at the bottom of an ember-table so that it will allow the user to insert new rows to the table. Which approach should I take? The idea is similar to the one asked here but using a fixed row and ember-table.

filter an ember model

javascript,ember.js,ember-cli
I'm more of a backend guy trying to get a bit into front end specifically Ember. I've already built an api now I'm trying to create almost like a autocomplete search (similar to Angulars filter | ngModel). Here is my api: { data: [ { id: 6, name: "Alexandrine Skiles",...

How to set the i18n.locale from within an initializer

ember.js,ember-cli,ember-i18n
I would like to set 'i18n.locale' from within an initializer in EmberJS. I am using 1.12 via Ember-CLI with ember-i18n. I tried this import Ember from 'ember'; export function initialize(container, application) { Ember.set('i18n.locale', 'de'); } export default { name: 'user-locale', initialize: initialize } but am receiving Assertion Failed: Path 'i18n.locale'...

embjerjs select from dynamic data

javascript,ember.js,ember-cli
I am using ember-cli without ember-data. I have a form that requires a select drop down that is generated from some data from an api response. this is the api response: { "data": [ { "id": 1, "name": "host" }, { "id": 2, "name": "cPanel" }, { "id": 3, "name":...

Ember Simple Auth: how to keep data in a step by step process after redirection to login route

javascript,ember.js,ember-cli,ember-simple-auth
I'm creating an app using Ember.js. This application allows to book an appointment at the doctor. You have a booking process with a few steps. After step 1 (booking/start), you have a screen that shows up if the user isn't connected (booking/user). On this page, I have two links: one...

Ember CLI path based on server response

ember.js,ember-data,ember-cli
I'm developing a substantial ember app, using Ember CLI, and I'm struggling with a few aspects of it. What I want to do is: Show a dropdown list of options When the user picks an option, post their choice to the backend The response from the server contains data based...

Polymer 1.0 in Ember-cli, wrong appearance

javascript,ember.js,polymer,frontend,ember-cli
I have managed to integrate Polymer 1.0 to my Ember-cli project. This my Brocfile var vulcanize = require('broccoli-vulcanize'); var pickFiles = require('broccoli-static-compiler'); var mergeTrees = require('broccoli-merge-trees'); var EmberApp = require('ember-cli/lib/broccoli/ember-app'); var app = new EmberApp({ compassOptions: { sassDir: "app/styles/main", outputStyle: 'expanded' } }); //app.import("./bower_components/webcomponentsjs/webcomponents-lite.min.js"); var polymerVulcanize = vulcanize('app', { input:...

Can ember-cli watch and build automatically without running the server?

ember.js,ember-cli
Title is pretty much my question. I'm serving the dist directory differently and would still like the benefit of auto-builds but I don't need to run the server. I looked in the docs and the cli help but didn't see anything specific. I know the cli help doesn't contain everything...

Ember Data One to One Relationship Record Creation Fails

json,ember.js,ember-data,ember-cli
I receive the following error when I use Ember Data to create records from a JSON response. What gives? I am following what the docs state. Uncaught Error: Assertion Failed: Ember Data expected a number or string to represent the record(s) in the `user` relationship instead it found an object....

Ember: How to get computed properties from a nested model?

ember.js,ember-cli,rsvp-promise
First: I have no idea how to work with promises in Ember.js. I want to call a property of my controller which depends on async model-data which is also nested. Also, my model looks something like that: +-------------+         +------------+ | Method      | hasMany |  Practice  | |             +--------->            | |             |         |            |...

EmberJS: Render default template

javascript,templates,ember.js,handlebars.js,ember-cli
I am trying to build an Ember Application which I want to render a default template of the nested route into the index route. Here is the router.js export default Router.map(function() { this.route('posts', function() { this.route('featured'); this.route('authors'); this.route('popular'); }); }); Here is the posts-index.hbs template: <div class="posts"> <h2>Welcome to your...

Cannot read property 'match' of undefined at Ember.DefaultResolver.extend.podBasedComponentsInSubdir

ember.js,ember-data,ember-cli
I'm getting a really opaque error message (opaque in the sense I have no point of reference for my own source) from console, I'm not entirely sure where to look, I feel it's likely an error in library code but before posting this on github I'll just double check it's...

How does one access model data in a router/controller?

ember.js,ember-cli
Bear with me please, I'm new. Been breaking my head over this problem and sort of here as last resort. It's about how to access a model's data when that route loads. For instance, when /meals/2 loads, I want a function to run that sets the background of the document...

Load and unload multiple components in a sidebar using Ember

ember.js,ember-cli
I have a page where a user is building up an order for a customer. At various stages of the order they may get to a point where they need to add something else. For example, when selecting an address for the customer the customer may have a new address...

Multiple routers for an Ember app

javascript,node.js,ember.js,ember-cli,ember-router
Is it possible to have multiple router.js for an Ember app? By default one router.js will have import Ember from 'ember'; import config from '../../config/environment'; var Router = Ember.Router.extend({ location: config.locationType }); export default Router.map(function() { this.resource('sampleroute'); }); and other router.js will have import Ember from 'ember'; import config from...

ember build Parse error on line 1: {{#each messages as |message|}}

ember.js,ember-cli
Hi I was attempting to update my ember cli project from ember 1.8.1 -> 1.9.1 & handlebar 1.3.0 -> 2.0.0 however now I get the following error, when I use the command ember build : Build failed. File: ui/templates/components/ember-notify.hbs Parse error on line 1: {{#each messages as |message|}} {{#vie --------------------^...

with ember cli, how to specify different layout for a component within POD structure

ember.js,ember-cli
I have a a basic ember cli app with a component, and I wanted to specify different layoutName to the component based on a property passed to it. I am not sure how to achieve this. Right now I just want to know how to specify a templateName to a...

EmbeddedRecordsMixin not working as expected, what am I missing?

ember.js,ember-data,ember-cli
I'm trying to use embedded records in ember data and I think I'm missing something fundamental. I have two models app/models/video.js: export default DS.Model.extend({ title: DS.attr('string'), transcriptions: DS.hasMany('transcription', { embedded: 'always' }) }); app/models/transcription.js: export default DS.Model.extend({ video: DS.belongsTo('video') }); I also have a custom serializer app/serializers/video.js: export default DS.RESTSerializer.extend(DS.EmbeddedRecordsMixin,...

Ember error on refresh

javascript,ember.js,ember-data,ember-cli
I have a very simple toy app using Rails as an API and Ember 1.8.1 with CLI for the client. I have a typical sidebar setup where when you click the item, it displays next to the list. Everything works fine until you refresh the page with a list item...

Custom API calls with Ember Data

ember.js,ember-data,ember-cli
I don't know if this is possible with Ember data, although I am kind of doubtful, but the API I am working with supports being able to produce 'or' queries by hitting URLs like, /v1/subjects?first_name||last_name=*dr* this would result in a query that looks like select * from subjects where first_name...

watchman not found on phusion/baseimage Docker image with ember-cli

docker,ember-cli,watchman
Hi I'm working with ember-cli application on Docker image. When I run ember application using ember server I'm getting the following message version: 0.2.6 0.2.7 "Could not find watchman, falling back to NodeWatcher for file system events." I've tried in Dockerfile #install homebrew RUN git clone https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew ENV PATH="$HOME/.linuxbrew/bin:$HOME/local/m4/bin:$PATH"...

How to create unit tests for Ember.js adapter/serializers?

unit-testing,ember.js,ember-cli
I'm building an Ember CLI app (v0.2.3), and I have some unit tests that have been generated for me for the adapters and serializer in my app. The generated code looks like this: // app/serializers/my-model-test.js // Replace this with your real tests. test('it serializes records', function (assert) { var record...

ember-cli migration: global app module import

javascript,ember.js,ember-data,ember-cli
I'm having some slight ember-cli migration difficulties with the global application variable. In project/app/app.js I define App as: var App; Ember.MODEL_FACTORY_INJECTIONS = true; App = Ember.Application.extend({ modulePrefix: config.modulePrefix, podModulePrefix: config.podModulePrefix, Resolver: Resolver }); Then in a separate controller, project/app/controllers/auth.js, I attempt to access App using the following statement: import Ember...

How is Sorting achieved in an Ember model without using Array Controller?

ember.js,ember-data,ember-cli
Every google result is about an ArrayController sorting. Need a sorting mechanism without using ArrayController. There is a model where there are sort params. Like say 'sortOrder' as one of the properties in the model (which will be from a back end). Will be rendering this model using #each but...

emberjs ember-cli - how to remove deprecated notice for {{#each}}

javascript,ember.js,ember-cli
This is using ember-cli 0.2.3 (model) todo.js import DS from 'ember-data'; export default DS.Model.extend({ title: DS.attr('string'), isCompleted: DS.attr('boolean') }).reopenClass({ FIXTURES: [ { id: 1, title: "Complete Ember.js Tutorial", isCompleted: false }, { id: 2, title: "Checkout some more ember stuff", isCompleted: true }, { id: 3, title: "Solve world hunger...

Ember CLI Install Addon

ember-cli
can somebody tell me the difference between using ember install and npm install ... the docs are very slim in describing the exact function of ember install. Does ember install, actually call npm install? thanks...

How can I return a well formatted 201 with Express?

jquery,ember.js,express,ember-cli
I'm trying to build todoMVC with ember-cli using the DS.RESTAdapter and express to mock out the calls. The issue I'm getting is that when I try to save a new todo I see this error in the console: SyntaxError: Unexpected end of input at Object.parse (native) at jQuery.parseJSON (http://localhost:4200/assets/vendor.js:8717:22) at...

How can I include html with ember-cli only for a specific environment?

ember.js,ember-cli
In my Brocfile.js I'm importing a script: // Import script for development only if (app.env === 'development') { app.import( app.bowerDirectory + '/some-script/some-script.js' ); }; That works just fine. But I also need to include a small init script in the html (which isn't really a vendor asset) which should not...

Ember CLI Rails: Creating user model

javascript,ruby-on-rails-4,ember.js,devise,ember-cli
Ember (0.2.5), Rails (4.2), Ember CLI Rails, Devise, Ember CLI Simple Auth Devise Action for creating the user model on the 'user/new' controller. Currently the ruby code creates the user in the database however the javascript response is still failing. I haven't been able to find much resources on Ember...

Display Ember library versions in browser console on app load

ember.js,ember-cli
For some reason, I am having trouble remembering (or finding) how to turn on an option to display versions of ember, jquery, ember-data, etc. in the console automatically. Used to be very handy. I am on Ember-CLI 0.2.7. Ended up doing this in app.js: import config from './config/environment'; if (config.environment...

In Ember how can I create a component by name programmatically

ember.js,ember-cli
I can find lots of examples on how to create a component in Ember programmatically and add it to the DOM like this: var comp = App.FooBarComponent.create(); comp.appendTo('#someArea'); But what would you do if you wanted to do it by a name provided? var componentName = 'FooBar'; var comp =...

ember-2.0 angle-bracket component not working with [email protected]

ember.js,ember-cli,htmlbars,ember-components
Please what else do I need in order for ember-2.0 angle-bracket component to work with the latest ember-cli I am using ember-cli 0.27, nodejs 0.12.4 and emberjs-canary branch to test out emberjs-2.0. I created a bare bones new ember app with: ember new test-app and created a component with: ember...

Where do 3rd party JS libraries go?

ember.js,ember-cli,ember-cli-pods
In an Ember CLI app. If one wanted to use https://github.com/twbs/bootstrap/blob/master/js/tooltip.js http://www.ember-cli.com/ does not seem to mention anything specific about this. Where would this file typically be stored? At first glance, I was thinking of putting it in public/assets/js. What is the convention, if any?...

Ember-cli ProxyPass

ember.js,ember-cli,proxypass
I'm developing an app using ember-cli and it need to send http request to a server using a ProxyPass. My server looks like this : subdomain.domain.com/api/clients/users and Ember-cli create by default http://localhost:4200/ I tried to do this in my http.conf : ProxyPass /api/clients http://subdomain.domain.com/api/clients This is working fine for http://localhost/api/clients,...

Model object not preserved when using hash for model in ember route

javascript,ember.js,ember-data,ember-cli
EDIT: I've set up an actual repro of the issue on JSBIN Been trying to resolve this for a while now and I'm clearly not understanding how the relationship between model and setupController works. I have a model which is returning a hash; the result of two find calls: model(params)...

simple way to configure or modify indentation in default blueprints for `ember generate`

ember-cli
I am calling ember g controller foo command to output predefined snippets for controllers. The project I am working in needs tab based indentation but ember-cli blueprints use space indentation by default. Is there a simple way to configure ember-cli to use tabs instead of spaces? The ember-cli docs explain...

update dom after persistence emberjs

javascript,ember.js,ember-cli
I'm not using ember-data at least for the moment being. I was wondering how can I update the DOM after I create a new record? for example I add a new company. Here is a simplified version of what I do. since I am not using ember data this is...

Error message about #each looping over a non array when it is already an array

ember.js,ember-cli,ember-addon
I have updated to [email protected] and am getting the following error message when running ember serve on an addon project of mine to start the dummy app. Uncaught Error: Assertion Failed: The value that #each loops over must be an Array. You passed [search,create,read,update,delete] controller has: operations : ['search', 'create',...

Sorting data by timestamp on ember

ember.js,ember-data,ember-cli
I've looked at a few examples, but haven't been able to reverse-sort, so that newly generated objects are on top. My sortable items are in components, and I don't think I'm passing sortProperties & sortAscending correctly. lavender.js: export default Ember.Controller.extend({ needs: ['application'], sortProperties: ['timestamp'], sortAscending: false }); lavender.hbs {{#each model.comment...

How to get current route path in helper in Ember?

javascript,ember.js,ember-cli
I'm creating a helper and I need to access the current route name. I'm using Ember CLI with ES6 and so I don't have access to App object. Here's what I have. import Ember from 'ember'; /** * {{route-active 'route' ['stringIfActive' ['stringIfNot']]}} */ export function routeActive(params/*, hash*/) { var currentRoute...

Security problems in upgrading ember application

ember.js,ember-data,ember-cli,content-security-policy
I have an ember/ember-cli application that I am upgrading from 1.10 to 1.12. This application uses an API that runs on port 8000 in development. I have the following environment.js: module.exports = function(environment) { var ENV = { modulePrefix: 'myapplication', environment: environment, baseURL: '/', locationType: 'auto', EmberENV: { FEATURES: {...

Component exposed in ember addon is not recognised in ember app

ember.js,ember-cli,ember-addon,ember-components
I have an addon that records integration tests for ember: https://github.com/QuantumInformation/ember-cli-test-recorder However I find that when I import it into an ember cli project via npm and then use the component it exposes like so in appplication.hbs: <h2 id="title">Welcome to Ember.js</h2> {{outlet}} {{test-recorder currentRouteName=currentRouteName}} I get the following at runtime:...

Ember blueprint that injects environment config?

node.js,ember.js,ember-cli
I'm relatively new to Ember and was wondering if there is a way to create a blueprint/generator that would inject a new value into the environment config while maintaining all existing configuration. Is there some Ember magic that allows an existing file to act as the blueprint template? My ideal...

Accessing an Ember CLI app's config from within an addon

ember-cli
I'm developing an addon for Ember CLI which requires me to dynamically load files from the app. I should be able to do this with a command like require('my-app/models/load-me'). The only problem is that my-app could be anything, depending on what the developer named their application. If I had access...

How to create route in right way?

ember.js,ember-cli
I need to create 2 route /users/philosophy /topic/philosophy On /users/ there is a list of categories and on topic is a list of categories. On /users/philosophy there is list of users by category and the same for topic. Categories are same. So I created router: this.resource('categories', { path: '/:section' },...

How to set different Compass configuration options for environments in Broccoli?

ember.js,ember-cli,compass,broccolijs
I'm currently using the ember-cli-broccoli-compass plugin for compiling my SASS. However I'm having trouble being able to assign the HTTP path for image assets in the stylesheets for different environments. This is what I have so far: var EmberApp = require('ember-cli/lib/broccoli/ember-app'); var app = new EmberApp( { compassOptions: { httpPath:...

Ember.js: Loading related models directly

ember.js,ember-data,ember-cli
I dont understand how ember loads related models. Lets say thats my model: export default DS.Model.extend({ title: DS.attr('string'), description: DS.attr('string'), states: DS.hasMany('state', {async: true}) }) I load this on of my outer routes. When navigating though an ember-app (into nested routes), model-contexts are often provided for routes not by the...

Rails, ember-cli-rails gem

ruby-on-rails-4,ember-cli
I tried to deploy a Rails & Ember-cli application to a VPS by Capistrano. I have integrated Ember-cli into Rails by using ember-cli-rails gem. The problem happens when Capistrano wants to do assets:precompile. Throwing an error like EmberCLI Rails requires your Ember app to have an addon. In this case,...

Problems installing ember-cli using npm on c9.io IDE

node.js,phantomjs,ember-cli,cloud9-ide
I am trying to install phantom-js on a c9.io virtual machine / cloud IDE and I get the following error: $ sudo -s npm install --global ember-cli ... 0 info it worked if it ends with ok 28 info install [email protected] into /nix/store/a5ibcbcsm473kdr75kj4gpsr28ndnknp-nodejs-0.10.26/lib 29 info installOne [email protected] 30 info /nix/store/a5ibcbcsm473kdr75kj4gpsr28ndnknp-nodejs-0.10.26/lib/node_modules/phantomjs...

Using ember-data with custom serializer

javascript,ember.js,ember-data,ember-cli
I have you could say a non standard json api. I'm trying to use ember-data with it so from my reading around I need to create a serializer. I tried to find article online explaining how to do this but haven't found anything useful. I tried looking through the ember...

Ember CLI: Build for staging

ember.js,ember-cli
I'd like to create a build of an Ember CLI app for a staging environment. For staging, I'd like to essentially do exactly the same thing as production (minification, fingerprinting, exclude tests, etc), but want to pick up the environment variables for development. To attempt this, I changed my environment.js...

ember nested route not loading

ember.js,ember-data,ember-cli
Just trying to determine how to do this. For an image sharing site I have the following requirement. User is able to view an image User is able to comment on the image User is able to see comments from users friends on the image this is my router.js: this.resource('image',...

Accessing indexed item from array in HTMLBars

javascript,ember.js,ember-cli,htmlbars
I have a custom API that is not formatted for easy use with Ember Data. I'm having trouble getting the value of nested array properties from my api. api response: { "data": [ { "id": 6, "name": "Company Name", "links": [ { "rel": "self", "uri": "/address-book/company-name" } ], "details": {...

Ember-cli how to add FileSaverjs and Blobjs

javascript,ember.js,bower,ember-cli
I looked at this and that link. I bower installed file-saver and Blob. I am having a similar problem with both components so I will just talk about one. When I do import FileSaver from 'file-saver'; I get the following error. Error while processing route: some.route Could not find module...

Ember belongsTo relationship passing as nil to server on saving

javascript,ruby-on-rails,ruby,ember.js,ember-cli
Ember CLI 0.2.5 + Rails 4.2 using ember-cli-rails gem, active_model_serializer (0.9.3) I am currently trying to pass user into createRecord and it won't save or bind the user_id when passing to rails. Parameters come back as: {"course"=>{"subject"=>"CSE", "number"=>110, "credit_hours"=>3, "grading_scale"=>"Regular", "user_id"=>nil}} Ember Controller (Finding the user returns correct value) import...