Aurelia delegate vs trigger: how do you know when to use delegate or trigger?

Use delegate except when you cannot use delegate. Event delegation is a technique used to improve application performance. It drastically reduces the number of event subscriptions by leveraging the “bubbling” characteristic of most DOM events. With event delegation, handlers are not attached to individual elements. Instead, a single event handler is attached to a top-level … Read more

How can I add Font Awesome to my Aurelia project using npm?

Don’t add font-awesome resources to aurelia.json – you’d need font files too, which Aurelia don’t process. Instead, take the following steps. First, if you added anything for font-awesome already to your aurelia.json file, remove it again. Add new file prepare-font-awesome.js in folder \aurelia_project\tasks and insert the below code. It copies font-awesome resource files to output … Read more

Property change subscription with Aurelia

In some plugins I’ve been using DI to get the ObserverLocator instance from the container: import {inject} from ‘aurelia-dependency-injection’; // or from ‘aurelia-framework’ import {ObserverLocator} from ‘aurelia-binding’; // or from ‘aurelia-framework’ @inject(ObserverLocator) export class Foo { constructor(observerLocator) { this.observerLocator = observerLocator; } … } You can then do something like this: var subscription = this.observerLocator … Read more