Questions tagged [ember.js-2]

For issues relating to development with Ember.js, version 2.0.

At Aug 2015, Ember.js version 2.0 is released.

New features and removed api's are listed in changelogs:

67 questions
0
votes
1 answer

Ember 2 - Hide / show content component

I have a component app/components/offer-listing.js: import Ember from 'ember'; export default Ember.Component.extend({ isOfferShowing: false, actions: { offerShow() { if (this.get('isOfferShowing')) { …
Jeremie Ges
  • 2,747
  • 3
  • 22
  • 37
0
votes
1 answer

Error loading belongsTo relationship in Ember 2

I am having issues loading a belongsTo relationship - no errors get displayed, and no requests sent. The UI just remains blank. Given the following models: project.js import DS from 'ember-data'; export default DS.Model.extend({ name:…
JB2
  • 1,587
  • 2
  • 24
  • 40
0
votes
1 answer

Ember component action not bubbling up to template router

I have a component that should bubble an action up to its template router. I pass the name of the action to the component: {{project-table projects=model viewProject="viewProject"}} Inside my component (project-table), I have: import Ember from…
JB2
  • 1,587
  • 2
  • 24
  • 40
0
votes
2 answers

Loading relationship data using Ember 2

I am having some trouble loading relationship data using Ember 2.0. Given the following two models, Project and LineItem, I am trying to list all line items belonging to a given project: export default DS.Model.extend({ name: DS.attr(), …
JB2
  • 1,587
  • 2
  • 24
  • 40
0
votes
1 answer

How do I access properties from within an Ember 2 component?

I am having some trouble accessing properties passed to my Ember component, which is as follows: import Ember from 'ember'; export default Ember.Component.extend({ isRowEditorActive: function() { return this.get('items').length > 0; …
JB2
  • 1,587
  • 2
  • 24
  • 40
0
votes
1 answer

How to access a routes model in Ember 2

I am having some trouble accessing my route's model inside my template. My model is created successfully as part of an action defined in my home controller: actions: { createProject: function () { var project =…
JB2
  • 1,587
  • 2
  • 24
  • 40
0
votes
1 answer

In Ember 2, I am unable to get the event object when binding on=keypress event to {{input}}

In Ember 2, I am trying to do probably the most simple thing. When I bind an event to an input element, I expect the event argument to be passed to my action handler but I am unable to get that. Simply I require to check for keyCode 13 which is for…
Rahat Khanna
  • 4,570
  • 5
  • 20
  • 31
0
votes
1 answer

Is pod files structure the way to go in ember 2.x apps?

Is pod structure recommended over the traditional way of organizing files in ember projects using version 2.x ?
shanky
  • 6,283
  • 1
  • 11
  • 15
0
votes
1 answer

Is it possible to restrict loading model until some condition?

I have model called posts. And component called posts-list app/templates/components/posts-list.hbs: {{#each posts as |post|}} {{post.title}} {{/each}} main template: {{posts-list posts=model}} app/routes/posts.js: export default…
sl_bug
  • 5,066
  • 5
  • 21
  • 22
0
votes
2 answers

How do I get the BeforeObserver equivalent in Ember 2.3?

To preface this, I must clarify that I am using the legacy-controller and the legacy-view for the interim period while transitioning to Ember 2.3, found here: https://github.com/emberjs/ember-legacy-controllers Now, I have a property called…
Darshan
  • 937
  • 3
  • 15
  • 27
0
votes
1 answer

How do I get an object out of query params in Ember 2?

In Ember 2, for a URL with a query string of ?q[a]=1&q[b]=2, how do I get those params in the controller? I'm able to get a single string (q=foo) and an array (q[]=1&q[]=2), but I'm unable to get an object like mentioned above.
remino
  • 324
  • 2
  • 17
0
votes
1 answer

EmberJS, How access in a child template to the model in the parent controller

I have this router: // app/router.js Router.map(function() { this.route('battle', function(){ this.route('combats'); }) }); In the combats route I can access to the battle model easily using: //…
fguillen
  • 36,125
  • 23
  • 149
  • 210
0
votes
1 answer

EmberJS, How to NOT render the parent View

I have this router: // app/router.js Router.map(function() { this.route('battles', function(){ this.route('battle', { path: ':id' }, function(){ this.route('combats', function() { this.route('new'); }); }); …
fguillen
  • 36,125
  • 23
  • 149
  • 210
0
votes
0 answers

Adding / Removing relationships with Ember.js / Ember-Data, telling the API what changed?

I have two models in a many-to-many relationship. On the Ember side I'm setting both up in my model. When I go to add a new relationship between the two of them I'm using model.get('relationshipName').pushObject(otherObject), and then model.save();…
0
votes
2 answers

Ember, generating URL `url-to`?

I would like to generate a URL to a resource and show it to the User. I found the link-to but I don't want the whole element but only the URL. Something like: {{#url-to 'photos.show' photo}}
fguillen
  • 36,125
  • 23
  • 149
  • 210