Questions tagged [ember.js]

1

votes
2

answer
963

Views

Integrate Brunch with Rails

I'm trying to use below Brunch skeleton and integrate with my Rails app: Sassy Brunch with Ember and CoffeeSoup Is there a way to do this so I can still use Brunch operations like build and watch seamlessly within the Rails app? Or would we rather want to have separate Frontend for Brunch and use Ra...
1

votes
2

answer
2.6k

Views

Transition to a route after successful save without deleting record

Ember-1.0.0 and Ember Data 1.0 Beta 2 with Fixture Adapter. What I'm trying to accomplish is that after I call save I'd like to transition to a route if the returned promise is resolved. In this jsbin you can click 'New', type in someting then click 'Create'. The transition occurs, therefore the pro...
James
1

votes
3

answer
429

Views

Is there an easier way to debug ember addons

I have been just starting out with ember addon and one of the difficulty I am facing is to debug it. I have a separate repo for my addon(lets name it my-addon for now), and everytime I make any change, I have to 1) commit it 2) push the changes 3) go to consuming app and then re install the app fro...
Deewendra Shrestha
1

votes
3

answer
6.7k

Views

Ember re render component

I have a component with a jquery menu that transforms the DOM. I need to re render the component for initiate the structure again. The jquery menu doesn't work dinamically, so I need to re render the component. //Parent Component hbs {{menu-jquery model=model}} //Parent Component js export default...
Mario Gomez
1

votes
1

answer
138

Views

Share computed property code

In have a Users_Index view where I render all users. For each user I want to show a computed property. I do this in the corresponding ItemController. The code: // app/controllers/users/index.js import Ember from 'ember'; export default Ember.ArrayController.extend({ itemController: 'user' }); // app...
cache.zero
0

votes
1

answer
92

Views

How to map ember object hierarchy to Haxe

I have just started to create Haxe externs (strictly typed class definitions) based on the yuidoc output from the ember source. Now I need help to understand how to implement the kind of mixing architecture special to Ember. For example the Ember.Object extends the Ember.CoreObject - however I wasn'...
Axel Huizinga
1

votes
1

answer
158

Views

How to hide navbar in application template if the route is login

I have in my application template: {{outlet}} And in the login template, i don't want show the nav, so.. how exactly i could do this?? I searched but there isn't much resources. The only solution i create is take off the nav and put in all templates, except for the login.. But i feel that i'm doing...
1

votes
1

answer
422

Views

How to test Ember error substate, with Ember CLI test runner?

I've set up an error substate route/controller/template according to http://guides.emberjs.com/v2.2.0/routing/loading-and-error-substates/. Manually browsing my app, I can trigger error conditions and get directed to the substate. Confirmed with Ember Inspector. I'd like to automatically test the su...
Bluu
1

votes
1

answer
720

Views

Redirect to Login Route from Application Route if user is not authenticated

I'm using ember-cli-simple-auth 1.0.1. My doubt now is how can i force redirect to /login if the a user tries to access the application route / if he is not log in?
Marcus Woy
1

votes
1

answer
243

Views

Each model Ember not listing the models in template

I am using Ember.RSVP.hash to create different models in the same route, i successfully create the model records in the store, i can see the data in the console. The problem is that i can only list one the two models in my template. ( repos name but not the commit message ). Here the code Route va...
Koala7
1

votes
2

answer
53

Views

What's the recommended method for adding javascript functions in Ember-cli project?

I want to create a library containing general-purpose javascript functions and classes for use in any Ember object in an Ember-cli project. What's the recommended procedure for doing this?
user5638246
1

votes
1

answer
848

Views

Export JSON to Excel using EmberJS

I have a JSON object being returned by the service. I want to export that to a xls or excel file on the click of a button. When I make a get service call the server return with this: 'objects': [ { 'amount': 1000, 'date': '2015-12-08', 'description': 'sdadas', 'from_id': 'Prateek', 'id': 1, 'to_id'...
Prateek Choudhury
1

votes
1

answer
190

Views

Ember-simple-auth change cookie on the fly

I have an Ember application and I use ember-simple-auth for authentication. I want to change the cookie stored, that is related with the authentication, on the fly. The reason is a feature of impersonating another user. I have used Ember.$.cookie but it returns 'undefined'. How could I change the c...
manosagent
1

votes
1

answer
855

Views

How to lookup associative array/object value in Ember template using string key

I know that the traditional syntax for looking up array values (by key) in Ember is to use .[] syntax, like: {{myArray.[0]}} However, I have an associative array, and despite having a separate model/controller property that lists the keys, I'm unable to perform a lookup - the value is always undefin...
Craig Otis
1

votes
1

answer
436

Views

Ember onClick event not completing action

I'm working on an Ember app and I'm having trouble wrapping my brain around handling the DOM and components. I have a companies-expander component that will display every company in the database and will expand to show the jobs that are available at the company: //companies.hbs Companies {{#each mod...
Zach Krzyzanowski
1

votes
1

answer
212

Views

Remove application's container in ember

I see that the whole ember app is rendered wrapped inside a div like: ... is it possible to render outside it? (I'd like to keep all the content inside tags)
Cereal Killer
1

votes
2

answer
78

Views

How to use jquery.when with ember data promises

I'm trying to fire a callback when multiple ember models have finished their save methods. var promises = []; modellist.forEach(function(mymodel){ promises.push(mymodel.save()) } $.when.apply(null, promises).done(function () { console.log('finished promises'); } console.log('finished method'); The a...
Weissvonnix
1

votes
1

answer
917

Views

Call service method from a property

I am getting an error in the console saying the service is not defined when attempting to call a service method inside a property on my controller. itemImage: function(){ return this.get('s3').getItemImage(this.get('user.active_auction'),this.get('model.item_image')); }.property(), The error states...
Jordan
1

votes
1

answer
481

Views

Ember loop through an array of checkboxes and get checked items?

I have an Ember.js application (using the Ember CLI). I have a component called sideMenu with the files sideMenu.js and sideMenu.hbs. Within the .js file, I have an array of vehicle names like this: export default Ember.Component.extend({ vehicles: ['Audi', 'Chrysler', 'Harley Davidson'], vehicleChe...
Nag
1

votes
1

answer
677

Views

Undefined method 'config' for ActiveModel::Serializer

I am trying to follow several tutorials to connect Rails 5 in API mode with Ember application but in all of them once I create new initializer and use: ActiveModel::Serializer.config.adapter = :json I get 'undefined method 'config' for ActiveModel::Serializer ...' I am using 'active_model_serializer...
Adnan Pirota
1

votes
1

answer
108

Views

Show Content Security Policy at app startup

I am trying to setup the CSP and Ember is doing something funny, difficult to describe what. I am rightly configuring one part, and it is failing in another part. Or suddenly, livereload is blocked. Or it says that script-src is not defined, and falls back to default-src, which is fine, if it weren'...
dangonfast
1

votes
2

answer
68

Views

Errors not populated

I receive errors from the backend: { 'errors': { 'extra_comments': [ 'This field may not be null.' ], 'name': [ 'This field may not be null.' ], 'due_date': [ 'This field may not be null.' ], 'price': [ 'This field may not be null.' ], 'payment_type': [ 'This field may not be null.' ], 'description'...
dangonfast
1

votes
1

answer
170

Views

On starting ember server embercli throws some errors

error is not defined ReferenceError: error is not defined at ChildProcess. (/home/dexter/weaponx/lance/learnerapp/node_modules/ember-cli/node_modules/sane/node_modules/fb-watchman/index.js:204:15) at emitTwo (events.js:88:13) at ChildProcess.emit (events.js:173:7) at maybeClose (internal/child_proce...
sureshprasanna70
1

votes
1

answer
272

Views

How do I access the Ember Data Store from a service?

I have an Ember CLI application. I'm trying to access the Ember Data Store from a service (service name: users.js) like this: console.log(this.store.peekAll('accounts').toArray()); I am calling this service from a route and when I do this, I get the following error: Error while processing route: acc...
Nag
1

votes
2

answer
250

Views

Ember, Visual Studio, and WebApi

I primarily use Visual Studio, C#, and WebApi for my projects. We're looking to utilizing Ember, Ember relies heavily on Node Package Manager. Which Visual Studio does support, but is there a way to integrate Ember and their Command Line better into Visual Studio? Currently, we would use Node and...
Greg
1

votes
1

answer
41

Views

Layouts in Ember

What is the preferred way to have application layouts in Ember 2.0? I would think through components, but they are not yet routable. We used to use views, but those have been deprecated. Thoughts?
anthonycollini
1

votes
1

answer
71

Views

Test fails in ember

I'm facing some problems figuring out how to pass a test in Ember. The thing is, I'm trying to use NProgress in my project, but I can't pass my tests. I'm following this example to create a mixing for it, and everything is working fine, besides the tests. That's the mixing I created: import Ember fr...
Marcelo Borges
1

votes
1

answer
56

Views

Does ember's dist output require node?

When you build an Ember application the output is placed in the dist folder. Can I take this output and stick it into IIS on a server without installing node? I understand that during development I need to have node.js installed. I'm asking if the production host server will require node.js if I'...
P.Brian.Mackey
1

votes
2

answer
121

Views

Ember 2.x get model's relationships at subroute of that model

Imagine that I have two models, Author and Book. // models/author.js DS.Model.extend({ name: DS.attr(), books: DS.hasMany('book') }); // models/book.js DS.Model.extend({ title: DS.attr(), author: DS.belongsTo('author') }) It would be nice to have an endpoint at /api/authors/{authorID}/books to be ab...
Mike Nitchie
1

votes
2

answer
895

Views

Cross Domain Request w/ Cors

I've got an ember solution, which locally runs on http://localhost:4200. It request data from my WebApi Application, which utilizes Windows Authentication. That currently runs on http://localhost:11470. For some bizarre reason when my WebApi application responds it leaves off content such as: Acc...
Greg
1

votes
1

answer
37

Views

How to get reference to newly created record?

I have following use case: 'I create resource 'project' in action handler in a controller, after that I'd like to make a transition to a newly created route'. My intentions looks something like this: createNewProject: function() { this.store.createRecord('project', { title: this.g...
SuperManEver
1

votes
1

answer
303

Views

Ember access variable inside Mixin

import Ember from 'ember'; import myConst from '../utils/constants'; export default Ember.Mixin.create(myConst, { getFieldId: function(productCode) { console.log(myConst.MY_METHODS.FIELD_ID); //Not able to access this } }); My constants.js looks like var myConst = {}; myConst.MY_METHODS = { FIELD_ID...
testndtv
1

votes
2

answer
46

Views

Fetch a sigleton nested singleton resource in Emberjs

I am trying to fetch a singleton resource which has the following route: /api/users/:user_id/profile. The user model knows nothing about the profile. The models are defined as follows in Rails: class UserProfile < ActiveRecord::Base belongs_to :user end How can I define EmberJS models and routes so...
roman
1

votes
1

answer
472

Views

Sending an action from a sub component to parent component in Ember 2.2

Hi I'm trying to send an action from a sub component back up to the parent component so it can access this.store and perform a DB action. The basic layout is this: app/templates/item/index.hbs -> does a loop of items using component {{#each model as |item|}} {{item-listing item=item}} {{/each}} app/...
Jonathan
1

votes
2

answer
71

Views

How to fetch data from server for a nested route ember 2.3.0

I have a post model and a comments model that are related as shown below: // app/models/post.js import DS from 'ember-data'; export default DS.Model.extend({ //.... comments: DS.hasMany('comment'), //.... }) // app/models/comment.js import DS from 'ember-data' export default DS.Model.extend({ //......
Optimus Pette
1

votes
1

answer
32

Views

Can “model” be treated as special controller property in EmberJS

I have 3 related questions; Q1: In EmberJS, can 'model' be treated as special controller property. I am saying this, coz consider for a controller (has model returning firstName & lastName attributes), I have a property 'isVisible' So in the template, I would say {{#if isVisible}} Hello {{model.fi...
testndtv
1

votes
2

answer
135

Views

Access a route model from non nested route with Ember js

I am wondering the appropriate way to access a route model from a different non nested route controller. If I have my routes set up like this: (this works however, not sure if its proper) App.Router.map(function() { this.route('admin'); this.route('page1'); } And the Page 1 route has a model like t...
user1088963
1

votes
1

answer
67

Views

How to not start an EmberJs App with static assets present

Is there a way to get the minified EmberJs JS and CSS assets, but not have the EmberJs App start? The use case is you have a login.html where you'd like the User to login, and want the static assets ahead of time, so the User doesn't have to wait for them when they get redirected to the authenticate...
Aaron Lelevier
1

votes
1

answer
403

Views

Ember Data does not add parameters to a post request

I'm trying to create a resource on my rails backend using ember.js as the frontend. In the router.js I have this: //... this.route('posts', function() { this.route('new'); }); //... This is app/templates/posts/new.hbs Title {{input type='text' value=model.title}} Body {{input type='text' value=mode...
Optimus Pette
1

votes
5

answer
1.3k

Views

No permission to create new ember-cli app

Everytime I use the command ember new myapp it throws me these errors: /usr/local/lib/node_modules/ember-cli/node_modules/configstore/index.js:53 throw err; ^ Error: EACCES: permission denied, open '/Users/MyAccount/.config/configstore/ember-cli.json' You don't have access to this file. at Error (na...
Shoplifter20

View additional questions