In Aurelia 2, I have an issue with rendering a repeated element in a view using a Set
collection in the viewmodel.
The following sample code is based on the samples in Rendering Collections. (I only changed the code somewhat so that it is now possible to greet multiple friends in a specific language.)
MyApp.html:
<h1>My Friends</h1>
<p repeat.for="[name, info] of friends">${info.message}, ${name}!</p>
MyApp.ts:
interface FriendInfo {
message: string;
}
export class MyApp {
friends = new Map<string, FriendInfo>([
['Alice', { message: 'Hello' }],
['Bob', { message: 'Hola' }],
['Carol', { message: 'Ni Hao' }],
['Dana', { message: 'Molo' }]
]);
}
With this code, Aurelia vNext currently renders empty strings for the greetings and the names. However, in Aurelia v1, this code seems to work just fine.
Am I perhaps doing something wrong here?