I am trying to add Intl polyfill to an ember app, but have run into the issue that I need to add a script tag that executes async functions before evaluating other script tags. In ember I can add a new <script> tag to index.html, that is placed before the emberjs tags: Everything works fine when assets/…
Tag: ember.js
Catch (failed)net::ERR_NAME_NOT_RESOLVED in an Ember / Ember Data app
I’m working on an Ember app which uses Ember Data. We mainly use Rails and Postgres for the backend, but a smaller portion of our data is stored in a WordPress backend. WordPress is running on wp.example.com. Ember Data is setup to work with both the Rails and WordPress backends, so I can do things like…
Dynamic template arguments for an Ember component
I’ve run into a situation with a glimmer component that renders a LinkTo component within. The issue is that LinkTo treats the case where @model={{undefined}} and the case of omitting the @model argument as 2 different cases. This is because the default value for it is a special value of UNDEFINED. When…
Ember input type number to allow only 2 digits after Decimal
I am working on an Ember application, an input type number as below Then I have a following JavaScript Code written to limit the entry of digits after decimal, this function is called in Key-Down event. Its working but what it is doing it, it allowing 3 digits after decimal but when I am posting its value on …
Timezone sensitive date comparisons in Javascript
I’m determining the difference between two calendar dates in Javascript in an Ember app. I’m currently using date-fns’s differenceInCalendarDays. Now that mostly provides the desired results, the only issue is that I need to handle calculating the difference between 2 dates that is sensitive…
Ember Octane Upgrade How to pass values from component to controller
Upgrade from Ember <3.15 to >=3.15. How do I pass form values from a controller into a component? I cannot begin to explain the number of diagnostic combinations attempted and their corresponding errors received. So, I figure it best to ask how it should be done correctly? Is Glimmer involved? A simple …
index operator in handlebars say Unexpected token ,
I have #each loop in my ember app and want to know index of loop, so I try to using {{@index}} like this : But in chrome, I get this error: My ember.js version is rc8 and handlebars is 1. I need a solution to find index of #each. Answer You can get the contentIndex from itemViewClass of the #each
Combine linkTo and action helpers in Ember.js
I need to combine linkTo and action helpers in Ember.js. My code is: But I would like to make this something like this: And also: To: How can I achieve this? Solution Check my answer for Ember 2.0 compatible, OK for SEO solution. Answer Ember Link Action addon This is OK for SEO solution! Install addon Usage …
Dealing with touchMove events in iOS and Ember
I’m adding iOS support to an Ember application which uses Flame.js. Most Flame.js widgets don’t have built-in support for touch events at the moment, so I’m working on adding it to the ones I need. I’ve got touchStart and touchEnd working just fine for clicking and certain state transi…