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
10
votes
2 answers

How to access the Ember Data Store from the console?

In Ember 2+, does anyone know how to get a reference to the Ember Store in order to troubleshoot Model mapping in the javascript console? It was possible through App.__container__.lookup in Ember 1, but this doesn't exist anymore, and it's bloody…
Fabien Benoit-Koch
  • 2,784
  • 2
  • 21
  • 33
9
votes
5 answers

How do I make dynamic classNames in an ember 2.0 component?

For example: Ember components allow you to add a classNames array and those classes will be added to the main div of the component. say we have this component called new-div export default Ember.Component.extend({ classNames:…
pfg
  • 213
  • 2
  • 7
9
votes
1 answer

EmberJS, How to import files using root path?

I have this a model in this path: /my-project/app/models/my-model.js And I want to import it from a route in this path: /my-project/app/routes/battles/battle/combats/new.js The import sentence looks like this: import MyModel from…
fguillen
  • 36,125
  • 23
  • 149
  • 210
8
votes
4 answers

How to access data from routes in an Ember application template?

I'm following along the docs for Ember 2.3 and can't seem to find anywhere something very basic: how does one access a value provided by the route's model hook inside the main template: application.hbs? routes/client.js // ... export default…
Slavic
  • 1,891
  • 2
  • 16
  • 27
7
votes
5 answers

How do I pass in more than one parameter to the onChange action for the select element in Ember2.3

I have a select element within a loop, and the action I want to be triggered needs to have two parameters: the selected option of the select element and the item we are looping with. My code looks like so: {{#each loopItems as |loopItem|}}
Darshan
  • 937
  • 3
  • 15
  • 27
7
votes
2 answers

Using this.sendAction() in components?

I am using Ember 2.2.0 When writing components I used to propagate events from the component to the route (or whatever embeds the component) with this.sendAction(…). I checked out the docs lately and discovered that they advise another…
maximusmusterus
  • 203
  • 1
  • 2
  • 7
5
votes
2 answers

How to detect and save relation change in Ember 2.13.0?

I have documents list. Every document has client attribute defined by belongsTo. When user change client in one of documents i want to show in the counter how many documents are changed. And when user decide he will press "publish" button which will…
Jiro Matchonson
  • 875
  • 1
  • 17
  • 24
4
votes
1 answer

How to focus specific input elements in Ember 2

I am learning Ember 2, and trying to write a simple inline editor. My problem is auto-focusing the input element. The component's template is as follows: {{#if isEditing}} {{input type="text" placeholder="Line item" autofocus="autofocus"…
JB2
  • 1,587
  • 2
  • 24
  • 40
4
votes
1 answer

Using component vs partial for 'site header' in ember.js

This is more of a design/best practice question, in Ember 2.x I am building a new ember web app, and for the site's header, I created a separate component, site-header and included that in the application.hbs as…
shanky
  • 6,283
  • 1
  • 11
  • 15
3
votes
2 answers

Ember Server: "Port 4200 is already in use", when no process runs on 4200

When running my ember application with ember serve -e local I get: Port 4200 is already in use. Which is weird because no application is running on 4200. I tried to open a dummy HTTP server on 4200 with http-server and it works just fine. It also…
geauser
  • 1,005
  • 8
  • 20
3
votes
0 answers

Set nested property value and create parent if it doesn't exist

So I am using Ember JS 2.2 and I have a plain JS object and want to set the value of a nested property. However I don't know if some of the parent properties already exist. If they don't exist I would like to create them as an empty object.…
TheMethod
  • 2,893
  • 9
  • 41
  • 72
2
votes
2 answers

Ember model Not Bind Dynamically using Link-to

I created an ember demo,A parent view and it's child this is the parent view

A list of Todo Tasks

    {{#each model as |todo|}}
  • {{#link-to "todos.details" todo}}{{todo.desc}}{{/link-to}}
  • {{/each}}
{{outlet}} and Its js…
abdoutelb
  • 1,015
  • 1
  • 15
  • 33
2
votes
1 answer

Ember pass callback to service - undefined this

I have a service to upload many large files in chunks export default Ember.Service.extend({ run(files, callbacks) { // ugly async FileReader and ajax // calling callbacks during the process } }) I need a bunch of callbacks to show…
Oleg Antonyan
  • 2,943
  • 3
  • 28
  • 44
2
votes
1 answer

Using Not Or/Not And on Ember CLI

So I'm wondering if there is a computed string property that negates the current boolean value of a property. For example, in the computed property 'isDisabledSubmit' below, I added an exclamation mark in front of isValidEmail and isValidMessage in…
Kev
  • 23
  • 4
2
votes
1 answer

How do I render multiple outlets in one template file using ember 2.3

I'm trying to render multiple .hbs snippets into their respective outlets. However, the following renderTemplate does not work: renderTemplate: function() { // default behavior, renders the home template this.render(); …
Darshan
  • 937
  • 3
  • 15
  • 27
1
2 3 4 5