Questions tagged [ember-controllers]
73 questions
51
votes
1 answer
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 = Ember.ArrayController.extend({
// properties
…

bguiz
- 27,371
- 47
- 154
- 243
8
votes
3 answers
Calling a controllers method in another controller Ember
I am using Ember's Need Api to call a method of a controller in another controller. I am able to get the instance of the controller but when I am calling it method it returns me this error TypeError: Object [object Object] has no method.
This is…

mohsinali1317
- 4,255
- 9
- 46
- 85
7
votes
2 answers
Ember 2, filter relationship models (hasMany, belongsTo) and calculate computed property based on relationships
These are my files:
Models
app/models/basket.js:
export default DS.Model.extend({
name: DS.attr('string'),
house: DS.belongsTo('house', { async: true }),
boxes: DS.hasMany('box', { async: true })
});
app/models/box.js:
export default…
user4412054
4
votes
3 answers
how to bind Application controller property in another controller ember
i have search property in ApplicationController and its linked with input field of searching.
i want to access search field of ApplicationController in ProjectController. it should be sync.
i use following code but its not working.
/…

Muhammad Ateek
- 1,057
- 3
- 14
- 24
4
votes
1 answer
Ember.JS - toggleProperty toggling all items in list
I have a toggleProperty in the container to toggle a set of actions on each item. The problem is, when the toggle button on 1 item is clicked, every item is toggled, instead of the one that's clicked.
I would love to know how to toggle only the…

TheEarlyMan
- 384
- 4
- 15
3
votes
1 answer
When should I use controllers vs routes in EmberJS?
I know this question might seem a little duplicate but the other version of this question is old and some of the content (such as Views) aren't even a part of ember anymore.
I'm about 4 weeks into my internship as a front-end developer working with…

Cameron
- 2,805
- 3
- 31
- 45
3
votes
3 answers
Ember passing a model to transitionToRoute
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…

Edward Ellsworth
- 455
- 5
- 12
3
votes
1 answer
Ember.js Calling model's method from controller
Is there any way to get a hand on the model from a controller? I would need to call an instance method defined on the model and
this.get(methodName)(params)
does not work, as it loses the 'this' call context within the called function.
Thank you.

Tudor Vintilescu
- 1,450
- 2
- 16
- 28
3
votes
2 answers
In Ember.js how to notify an ArrayController's corresponding itemController, when a property on the ArrayController changes
I have an EmailsController (ArrayController), which stores all the emails. I have an EmailController (ObjectController) that has a parameter that stores if the actual Email is selected or not. I am trying to implement a button in the emails…

gsanta
- 754
- 6
- 21
2
votes
1 answer
send value from ember component to parent template
I want to pass lat and lng from an ember component to another ember component (g-map). My handlebars template:
{{!-- Index.hbs --}}
See The Weather Outside…

cahyowhy
- 553
- 2
- 9
- 26
2
votes
1 answer
What is wrong with this Ember.js handlebars if statement?
Hi i have an ember app with a handlebars if else statement that always shows the if part and never the else
I have read everything i can in the ember documentation here and here
and searched the net countless times:(
The code for my controller and…

tharderer
- 83
- 1
- 5
2
votes
2 answers
Ember component cannot use access controller property via "needs"
I'm trying to change a controller's property from a component as follows(JSBIN example http://jsbin.com/gevuhu):
App.CategoryManagerController = Ember.Controller.extend({
selectedCategory: null,
});
App.BlogPostComponent =…

Noor
- 19,638
- 38
- 136
- 254
2
votes
1 answer
this.controller is undefined in Route class
I am developing SPA using EmberJS latest 1.7.0,
according to Ember docs, the route contains a property that holds a reference to the controller, but it always returns undefined in all my routes.
ApplicationRoute = Ember.Route.extend({
queryParams:…

engma
- 1,849
- 2
- 26
- 55
2
votes
1 answer
Calculate sub total emberjs
I create a shop cart. I using fixture adapter.
My models
App.Clothing = DS.Model.extend({
name: DS.attr('string')
, category: DS.attr('string')
, img: DS.attr('string')
, price: DS.attr('number')
, num: …

rusnasonov
- 752
- 2
- 12
- 23
2
votes
0 answers
EmberJS: programmatically adding a child view to a collection view without changing underlying content
My EmberJS app is confusing me a lot at the moment. I have a collection view, that in turn defines an itemViewClass of a custom view I have defined in my code. Something like:
App.CarouselView = Ember.CollectionView.extend({
itemViewClass:…

Parijat Kalia
- 4,929
- 10
- 50
- 77