I'm trying to dynamically generate a route-href
in a list of items. I basically have this:
this.items = [
{
name: 'Foo',
route: 'item',
routeParams: {
id: 1
}
},
{
name: 'Bar',
route: 'item',
routeParams: {
id: 2
}
}
];
And in my view:
<ul>
<li repeat.for="item of items">
<a route-href="route: ${item.route}; params.bind: ${item.routeParams}">
${item.name}
</a>
</li>
</ul>
But Aurelia tells me:
aurelia-logging-console.js:54 ERROR [route-href] Error: A route with name 'undefined' could not be found. Check that `name: 'undefined'` was specified in the route's config
If I print the ${item.route}
and ${item.routeParams}
they do contain the correct values:
<ul>
<li repeat.for="item of items">
<a route-href="route: ${item.route}; params.bind: ${item.routeParams}">
${item.name} ${item.route} ${item.routeParams}
</a>
</li>
</ul>
Why? :/