Aurelia repeat.for limit

If you want to start at a different value you can edit the TakeValueConverter at the toView method add a third parameter.

toView(array,start,count){
  return array.slice(start,count);
}

But then you have to track the last position somehow yourself


Option 1: Use a value converter.

take-value-converter.js

export class TakeValueConverter {
  toView(array, count) {
    return array.slice(0, count);
  }
}

app.html

<require from="./take-value-converter"></require>

<div repeat.for="t of allTags | take:5">${t.name}</div>

Live example of this scenario and many others here.

Other docs on value converters at aurelia.io

Option 2: repeat over a number

<div repeat.for="i of 5">${allTags[i].name}</div>