Dynamic Aurelia

From someone used to developing in a “traditional” way, switching to a javascript framework is like crossing over to a different universe where the laws of physics do not really apply. They might seem similar but they’re not. Take inheritance for instance, the foundation stone of OOP and throw it down the drain. No more inheritance, everything is composition right now. Yet in time you will learn the new laws and adapt....

September 9, 2016 · len

Update NumericTextBox precision on the fly

As currency selection changed you naturally want to change the precision and format of a NumericTextBox which contains an amount in the given currency (damn JPY for not using the same precision as everyone else). At a first glance one might think this can be accomplished using computed properties and something like: <pre lang="javascript"> @bindable precision:number = 2; @computedFrom('precision') get step():number { return Math.pow(10, - this.precision); } @computedFrom('precision') get format():string { return "n" + this....

August 23, 2016 · len

Dispatch change events in custom components

This is the first post about Aurelia and the Kendo-UI-Bridge. It’s a brave new world for me. The goal was to create a custom component (which wraps a ak-combobox) and dispatch a change event in a similar way to the standard components (i.e ak-combobox, ak-datepicker, etc.). <pre lang="html"> <input ak-datepicker="k-value.two-way: model.date" k-on-change.delegate="onChange($event)"></input> For these components, the change event is dispatched after the model changes. In my component code I had initially wrapped the k-on-change from the base component and continued dispatching it....

August 10, 2016 · len