Thoughts, etc.

Tracking the occasional random walk

ember

Ember pagination links

2018-01-16 / Leave a Comment

An Ember project I’m working on needed a simple set of links to move through a paginated JSON API. There are a few pagination-related addons out there, but they tend to want to deal with your data and model collections, as well as the display of pagination links. I was looking for something that would … [Read more…]

Posted in: open source Tagged: ember, ember-addon, ember-pagination-links

Clearing an Ember Paper select component

2017-09-01 / Leave a Comment

To allow users to clear the selection of an Ember Paper {{paper-select}} component, simply pass it the  allowClear=true option:

Allowing a paper-select component to be cleared
1
2
3
4
5
6
{{#paper-select
    placeholder="Select a thing..."
    required=false
    allowClear=true
    ...
}}

This option is passed along to the ember-power-select component that ember-paper uses under the hood, so the resulting clear button can be styled accordingly. For example,

Styling the clear-selection button
Sass
1
2
3
4
.ember-power-select-clear-btn {
  position: absolute;
  right: 25px;
}

Thanks to @miguelcobain for this tip on the community Slack channel.

Posted in: front-end Tagged: ember, ember-paper

Many-to-many relationships in Ember CLI Mirage factories

2017-03-27 / 1 Comment

The many-to-many example provided with the introduction of Mirage 0.3 lays out how to create many-to-many joins between specific instances of two models. It does this by hard coding the creation of a few books and a couple of authors, as well as the links between them, but stops short of using factories to generate such relationships … [Read more…]

Posted in: code Tagged: ember

Ember’s live reload server doesn’t live reload addons

2017-03-13 / Leave a Comment

The title pretty much says it all on this one. I just started playing around with Ember, and one of the first things I tried to do was include the ember-simple-auth addon in a brand new project. I tried following the step-by-step instructions in the readme as well as the ones shown in the introductory video. Nothing … [Read more…]

Posted in: Uncategorised Tagged: ember, notes