Questions tagged [ember-controllers]

73 questions
0
votes
1 answer

What content would a automatically generated controller in Ember (Ember-CLI) have if I wrote it down explicitly?

In the official Ember documentation is a section describing automatically generated controllers, once the model in a route has been set: http://emberjs.com/guides/routing/generated-objects/#toc_generated-controllers I wonder what would be the…
jessica
  • 480
  • 6
  • 17
0
votes
1 answer

set CSS class depending on returned string with Ember

Im still learning ember and i didn't got how i can apply certain CSS class depending on the returned string of a model on a certain controller. The official documentation (http://emberjs.jsbin.com/yoqifiguva/1/edit?html,js,output) only covers when…
Leonardo Galani
  • 184
  • 5
  • 22
0
votes
1 answer

Looping over an ArrayController fails as it is not an Array even though the Controller has the correct model with data

I am attempting to use an ArrayController to handle displaying some data that will be swapped out on user clicks. I currently get this error, Uncaught Error: Assertion Failed: The value that #each loops over must be an Array. You passed…
NarayanJr
  • 345
  • 2
  • 11
0
votes
2 answers

Ember route loading wrong controller

This is part of my router App.Router.map(function () { this.resource('report', {path: '/noticia/:report_id'}, function() { this.route('pictures'); }); }); I have defined an App.ReportPicturesController but my route App.ReportPicturesRoute…
cmolina
  • 973
  • 1
  • 11
  • 21
0
votes
1 answer

Transitioning from a route doesn't remove exited route's controller observers in Ember.js

Here is a JSBin to illustrate the problem I have. http://jsbin.com/patuje/4 I'm using a dependency injection to make a polling mechanism to an API, something like this App.Poller = Ember.Object.extend({ interval: function() { return 1000; …
0
votes
1 answer

SelectAll feature with Ember ObjectController and ItemController

I am trying to implement a multiselect row in a table. The parent controller is just an object controller. It has a model, and the view iterates over the recordset of the model as individual rows. I have implemented an itemController for all the…
Arun GK
  • 538
  • 3
  • 10
0
votes
2 answers

In Ember.js how can I get the rootURL from App.Router?

How can I get the rootURL in App.Router in my controller to use in my JSON request? If I specify a rootURL like this: App.Router.reopen({ rootURL: '/site1/' }); I want to be able to do something like this: FooController =…
williamt
  • 413
  • 2
  • 4
  • 15
0
votes
1 answer

Ember Needs API; ReferenceError: controllers is not defined

I'm working on an Ember project. I display a list of books and descriptions passed down from a server. Then the user can click on a particular book, which links to a comment page. But, I want to display the book description on the comments page. So…
Ruben Martinez Jr.
  • 3,199
  • 5
  • 42
  • 76
0
votes
1 answer

Ember Model empty until enter Route

I have an Ember App with Models for: Food Meals (there are other Models but these are ommitted for the sake of brevity). The router is configured thus: this.resource('food', { path: '/food/:food_id' }); this.resource('meals',function() { …
getdave
  • 208
  • 2
  • 8
0
votes
2 answers

Where I should run business logic on transitionTo in Ember.js

I have two separate views: List of posts List of comments connected with particular post When I click on particular post in #1 view I'm displaying #2 view using simple transitionTo('comments', post). What I want to do is to mark all comments…
piotrze
  • 479
  • 5
  • 14
0
votes
2 answers

An aesthetic or correct way of invoking an action that requires DOM manipulation as well as controller related tasks in EmberJS

My EmberJS app has a couple of actions (triggered by buttons) that require a view/DOM manipulation as well as setting a state in the controller, followed by a model update. The way I do this, it does not appeal to my programming aesthetics. It gets…
Parijat Kalia
  • 4,929
  • 10
  • 50
  • 77
0
votes
2 answers

Ember: route depending on the parent route's controller

Let's assume there are such routes: @resource 'group', path: '/group/:group_id', -> @route 'tweets' Now I have these paths and controllers: group - here I have model loaded by its id group.index - here I use that model group.tweets - here I…
Ivan Yurov
  • 1,578
  • 10
  • 27
0
votes
1 answer

cleaning up the controllers in Ember.js

What's happening to controller when we're quitting the appropriate route? Is that correct that observers set up there keep doing their job? And if so, what is the proper way to avoiding that? Some method opposite to setupController?
Ivan Yurov
  • 1,578
  • 10
  • 27
1 2 3 4
5