Browse files

feat(relative-time): aurelia-relativetime-signal

the relative time binding behavior now additionally listens to the aurelia-relativetime-signal. Use this to only notify RT about changes

related issue #241
  • Loading branch information...
zewa666 committed Nov 14, 2017
1 parent 05ab7a4 commit cce3b091c9437534aba26d7d6a8393fac4129526
Showing with 3 additions and 1 deletion.
  1. +2 −0 doc/article/en-US/
  2. +1 −1 src/rt.js
@@ -717,6 +717,8 @@ Now aurelia-i18n will automatically emit signals when internal changes happen an
> If you want to only update your relative time binding behaviors, you may use the signal `aurelia-relativetime-signal` which will only trigger those and safe unnecessary update roundtrips
### Complex objects for variables
In some cases it might be useful to define variables via complex objects. Let's take a look at below example. It shows a validation message to hint the user that a given field should be in range of min and max.
Now we could easily pass min and max as separate variables but on the other hand that involves more work you'd have to do manually if the source is a object.
@@ -33,7 +33,7 @@ export class RtBindingBehavior {
bind(binding, source) {
// bind the signal behavior
this.signalBindingBehavior.bind(binding, source, 'aurelia-translation-signal');
this.signalBindingBehavior.bind(binding, source, 'aurelia-translation-signal', 'aurelia-relativetime-signal');
// rewrite the expression to use the RtValueConverter.
// pass through any args to the binding behavior to the RtValueConverter

0 comments on commit cce3b09

Please sign in to comment.