Questions tagged [ember.js]

10059 questions
1

votes
2

answer
431

Views

Handlebars display object property dynamically by property name

{{#each modelItems as |item|}} {{ item.name }} {{#each selectedColumns as |extraCol|}} // line 27 {{ extraCol }} {{ item[concat ''' extraCols '''] }} // what I tried {{ item[(concat ''' extraCols ''')] }} {{/each}} {{/each}} In the template I have a list of modelItems. In the table there are some ce...
levi
1

votes
1

answer
24

Views

dynamic looping on a controller property

I am using ember 2.17. I added this property to a controller: export default Controller.extend({ newAttachments: new Array() ... }) I add elements in it through this controller action: setAttachment(file) { console.log('trying'); this.get('newAttachments').push(file); } When I use the action, the m...
Syl
1

votes
1

answer
55

Views

Ember js: How to increment a property in a controller while it is consumed in the template?

How to increment a property in a controller while it is consumed in the template? Case : I will consume same component multiple times in a template and I want to calculate how many times I've used that component in my template and I also want which component(tracking each component) gets destroyed...
Kathir Magaesh
1

votes
1

answer
50

Views

Ember data: computed attributes

I like to know if there is way to use computed properties with ember data for example I would like to have totalPrice calculated and saved from based on amount of other properties. Only way I think I can think of doing it using an observer
jpoiri
1

votes
2

answer
46

Views

Event handling in EmberJS components using {{#event}} blocks

I've been working on a UI in Ember and I am having difficulty implementing some of the event handling as described on the documentation here I have a section of a nav bar I need to highlight on hover. The nav bar is made up of ember-bootstrap components. {{#bs-navbar type='dark' backgroundColor='pri...
Abuelo
1

votes
2

answer
53

Views

emberjs component communication

I have some trouble with component communication. Lets say I have 3 nested components. Parent {{component-a}} -> which has child {{component-b}} -> which has child {{component-c}}. How can I access component-c directly from component-a, if component-c is not rendered. Is this even possible. Thank y...
coldfusion
1

votes
1

answer
44

Views

set alias for `model` hook

HELP If there is a model hook in app/routes/post.js say model() { return this.store.query('post'); } in template the returned promised is accessed using {{#each model as |post|}} ... {{/each}} Is there any way to set alias for the model? Something like this in route or controller? posts: alias('mod...
rinold simon
1

votes
1

answer
22

Views

Ember init failing to recognize _super

So my app has this component.js: import Component from '@ember/component'; import layout from './template'; export default class MyComponent extends Component { layout = layout; init() { this._super(...arguments); } } When the component is rendered I am getting this error in the chrome console: Asse...
The E
1

votes
1

answer
57

Views

Creating model attributes at run time in ember

I am creating an ember application where i want to implement a table built with ember. I am able to create a table using ember-models-table,and i am already able to render the table with column list and data. Now the problem is that the column list is coming from server and in ember-data i need to p...
vishal pareek
1

votes
0

answer
45

Views

Testing if a record and it’s relations have been destroyed

I've created an Ember service with a method to destroy a record and it's related data (defined by relationships in the model). This is my delete-user.js service. import Promise from 'rsvp'; import Service, { inject as service } from '@ember/service'; export default Service.extend({ store: service(),...
ndequeker
1

votes
1

answer
256

Views

LOGOUT only works on Internet Explorer(11) when the Internet Explorer Developer Toolbar is visible

LOGOUT only works on Internet Explorer(11) when the Internet Explorer Developer Toolbar is visible it working fine with chrome i tried all options from here but its not working is anything wrong in code ? I AM USING Ember here is code logoutPage(){ let parts = document.location.href.split('/'); let...
useless'MJ
1

votes
2

answer
161

Views

ember js trigger actions on my route

current URL: http://localhost:4200/bands router.js: Router.map(function() { this.route('bands', function(){ this.route('band', {path: ':slug'}, function(){ this.route('songs'); this.route('albums'); }); }); }); app/routes/bands.js export default Route.extend({ actions: { createBand: function(){ this...
Antediluvian
1

votes
2

answer
223

Views

Increase request timeout in Ember server

When using my Ember application in the Ember server ('ember serve'), any request that takes over 1.00 minutes fails with a 502 error. However, when I build my app, and use my local Apache server, requests don't fail for several minutes. How do I increase the request timeout in Ember server? I don't...
mmadsen
1

votes
0

answer
523

Views

Is it possible to use ESLint to lint Handlebars template?

I'm trying to write an ESLint plugin for Ember to check if the handlebars template together with javascript code has no issues. To achieve that, I need to lint .js component code together with .hbs component template. I don't have much experience with writing ESLint rules, but I guess all I need is...
ondrej
1

votes
1

answer
61

Views

Is 'incrementProperty' an async call?

Looking at the Ember tutorial on testing models, it treats incrementProperty as an async call. Why? app/models/player.js import Model from 'ember-data/model'; import { attr } from 'ember-data/model'; export default Model.extend({ level: attr('number', { defaultValue: 0 }), levelName: attr('string',...
myartsev
1

votes
0

answer
161

Views

Ember js 'ember build' error - Error: EBUSY: resource busy or locked, symlink

I have a existing quiet old ember.js project which I want to edit/mod. When running 'ember build' or 'ember serve' I get the error below. I read the other issues similar to this but none of the suggestion helped me so far. Can anyone please help how to solve this? Output from ember version --verbose...
parivajk
1

votes
0

answer
52

Views

How to signal the caller about the state of a promise

I have Ember code where the backend API calls are abstracted into a separate service. This service uses ember-ajax library for making backend calls. This service sets up the common headers, handles the timeout errors, and 4xx/5xx errors. And anything else like 422 (validation errors) are left to b...
robin bajaj
1

votes
0

answer
55

Views

Using “ember new” missing package error

I use ember-cli to create a new Ember application. Command ember new my_app_name --skip-git Encounter errors: error code E404 error 404 Not Found: @ember/[email protected]^0.7.9 verbose exit [ 1, true ] My version: $ ember -v ember-cli: 2.16.2 node: 4.7.0 os: linux x64
Paul Stewart
1

votes
0

answer
33

Views

Post data to Django rest API via emberJS in desired format

I have EmberJS using Django REST API, I have few checkboxes which I am using to filter the data based on selection of checkbox. Certificate {{input type='checkbox' checked=certA id='certificate_A'}} A {{input type='checkbox' checked=certB id='certificate_B'}} B {{input type='checkbox' checked=c...
Rohan
1

votes
1

answer
195

Views

Expanding D3 Pie Chart to fill SVG

I am trying to achieve two things: Make the existing pie chart in my application fill the available SVG element it is rendered in. Make the SVG element fill the size of the containing div it sits in so it is responsive. In my bar charts I achieve this by setting ScaleLinear and ScaleBand ranges on t...
Sorvah
1

votes
1

answer
1.1k

Views

In ember app chrome beta version - Failed to find a valid digest in the 'integrity' attribute for resource

In chrome beta version I got the below error in one of my app, Failed to find a valid digest in the 'integrity' attribute for resource 'http://localhost:8000/assets/vendor-2d2d91b98d3771c414a0b039e0b4d8c1.js' with computed SHA-256 integrity 'RtMfPvtdjkEbERLgZ70Z5f8rCHbsou/DcqEZCXiM8ME='. The resourc...
Ember Freak
1

votes
2

answer
160

Views

Ember JS: Assertion Failed: `AdapterError` expects json-api formatted errors array

I am making my first Ember/Phoenix app using JSONAPIAdapter. When doing a post request Ember responds with Assertion Failed: AdapterError expects json-api formatted errors array. Below is the relevant code: adapter/application.js import DS from 'ember-data'; import DataAdapterMixin from 'ember-simpl...
guy1997
1

votes
0

answer
34

Views

emberjs -ember-cli-chart extend doughnut chart to create rounded edge

how do i extend chart object in ember-cli-cart ?? i want to extend dooughnut to have smooth edges and some other features too. something like the below code ,but i want to create as a reusable ember component Chart.types.doughnut.extend({ draw: function (ease) { var ctx = this.chart.chart.ctx; var...
msreekm
1

votes
0

answer
141

Views

Click check box with ember-cli-page-object

I have a form with an input like so: {{input type='checkbox' class='foo'}} I want to click on in and then submit. My page object is like this export default create({ form: { selectFoo: clickable('.foo'), submit: clickable('#search'), }, }); However I can't select the checkbox and then submit. What a...
Rimian
1

votes
1

answer
45

Views

Ember JS and nested routes: the provided route name is invalid

I'm currently working my way through my first Ember JS app, using Balint Erdi's excellent book 'Rock and Roll with Ember JS' I'm stumped and would appreciate some help. I have the following (fairly simple) routes for my app: /clients /clients/:slug /clients/:slug/requests So for example, I wou...
ouairz
1

votes
0

answer
72

Views

How to properly destroy ember app and re-initialize a new one without re-defining methods that were previously defined

I am trying to load multiple ember apps in a spa using single-spa and single-spa-ember. However when I try to destroy an ember app and load another ember app I am getting following issue: index.js:12 Uncaught TypeError: Cannot redefine property: Inflector at Function.defineProperty () at Module.call...
Deewendra Shrestha
1

votes
1

answer
50

Views

Ember-Simple-Auth customised Devise Authenticator serverTokenEndpoint defaulting to users/sign_in

Pretty much as described in the title. I have a basic Ember Simple Auth setup. With a Devise Authenticator I've setup a custom URL for the serverTokenEndpoint. (Coffeescript) devise = DeviseAuthenticator.extend serverTokenEndpoint: ENV.apiBaseURL + 'session' tokenAttributeName: 'authentication_token...
JamesieBond
1

votes
1

answer
41

Views

Why is the Span that's nested in a Label preventing other nested items' ability to click to select checkbox?

The template is pretty simple, a checkbox component and string of text nested inside a label element: {{list-checkbox value=object.id sourceList=item.objectIds class=''}} {{object.name}} The checkbox template nested inside looks like this: Now, the expected behaviour is that clicking on anything nes...
lookininward
1

votes
1

answer
42

Views

ember.js - render() cannot find template specified by `into:` option

I would love some help on this as I've been trying to get this work for a few hours now. It seems like it should be something easy to do. I'm trying to create a separate layout within my Ember app. For example sake, there's the public application.hbs layout, and a private admin.hbs layout. On my rou...
John
1

votes
1

answer
57

Views

Getting proper data in modal

I'm trying to access data two times in my template, once on a list view, and once in a modal view. Upon clicking on the image, the modal will display a lot of the same data, just blown up. I'm having issues. The modal seems to be taking the last set of data, even though it's nested in the each state...
Chris Johnson
1

votes
0

answer
55

Views

ember-pouch: acceptance test strategies

I am using ember-pouch as my adapter for an ember-cli app (v3.0.0). For acceptance tests, I'd like to use the pouchDb adapter rather than mock everything. To implement this it seems the best strategy would be to: 1) create a new pouch-db instance at the start of each test and 2) destroy this in...
johnny_cp84
1

votes
0

answer
53

Views

Loading model on param route

I've successfully build out my app to have a proper child route and it works as it should when the user navigates through the site, but on load straight to the show route (exhibitions/slug) ember data seems to break; however, I'm still getting the proper response from the API. Here is my code, hope...
Chris Johnson
1

votes
1

answer
97

Views

catch block inside the model() hook in emberjs

Am I allowed to add a catch method in my model hook? i.e. something like this: model(params) { return this.store.findRecord('shop', params.slug) .catch( () => this.transitionTo('welcome.shops.index')) } } My goal is to route the user whenever he entered the incorrect slug. If there is a better appr...
Mikelemuel
1

votes
0

answer
70

Views

Can i use Emberjs + PHP + MySQL + Firebase > Emberjs

Our platform is a collaborative web design and marketing platform. We are using Ember js on the frontend that speaks to our backend(laravel) via Jsonpatch. Our DB is MySQL, so it is relational. This solution works fine for us, but there is a new need to bring in the collaborative way of working in o...
Gev Balyan
1

votes
1

answer
34

Views

ember JS : iterating over a json list and displaying in handlebars

I have a JSON object consisiting of an array of json objects. I want to display the provider group List for every application as a dataList in my JSON object . The JSON object is : {'Application1':[{'pg_id':'test00020','pg_name':'test20','sealID':'Application1'},{'pg_id':'test0003...
Avi Upadhyay
1

votes
0

answer
31

Views

Ember: How do I add a file into the treeForAddon after postBuild?

I have a case where I am using node-sass functions to generate a JS file after sass has completed compiling. I am outputting the file into the addon/utils directory; however, the file is not being picked until the project is built the second time. I feel this would easily be solved if I ran SASS fir...
munstrocity
1

votes
2

answer
216

Views

Assign specific color to specific segment in D3 Pie Chart

I have built a pie/doughnut chart using D3js (v4) as an Ember component and I am trying to have segments with specific labels be filled with a specific color but it is proving difficult. To color the charts I have the following code: marc = arc().outerRadius(radius - 10).innerRadius(radius - donutwi...
Sorvah
1

votes
1

answer
48

Views

Ember/Handlebars: Localization Helper with parameter array

I want to localize a string that contains multiple placeholders. E.g: Hello %@1, today is %@2 I'd like to pass an array to the localization helper in my template like so: {{loc 'greetings' myArray}} But that doesn't work, even though the documentation says it should. What does work is {{loc 'gr...
Androidicus
1

votes
0

answer
47

Views

Using a Model Instance in Ember Component Integration Tests

I am trying to do an integration test for an Ember component that requires a model as input. I have mock data, but I cannot pass it into the component directly because the model includes computed properties and other customizations that EmberData normally handles under the hood. However, I cannot fi...
kallenboone
1

votes
0

answer
142

Views

Electron require external javascript file outside app

I want to require an external javascript file in ember electron that is located outside the release app. So the user can adapt this javascript file without rebuilding the whole app. The file should sit in some directory of the users computer within/linksAlgs/sayhello.js In linksAlgs I have also a p...
HS_hendrix

View additional questions