2

Is this possible? Can't seem to get it to work. Trying to dynamically generate an array using computed from and displaying entries using a repeater.

@computedFrom('myArray')
  get onlyOneType() {
    let images =  this.myArray.filter((entry) => entry.type === 'a');
    return images;
  }
<div repeat.for="item of onlyOneType">
  $item.type}
</div>
Juliën
  • 9,047
  • 7
  • 49
  • 80
Ivan Bacher
  • 5,855
  • 9
  • 36
  • 56
  • 4
    the official `computedFrom` decorator only observe the expression specified, it does not try to get the object returned by the expression and then do further observation. There's another plugin that does this, you can have a look here https://github.com/bigopon/aurelia-deep-computed (dis: i created it) – bigopon Jun 08 '20 at 22:36

0 Answers0