Trouble Instantiating multiple components of the same type with separate scope

Hi,

I am unsure of how to render multiple components of the same type while giving each its own component scope. In my jsbin example, I want each star rating to be separate, but the events for each component seem to share the same list of stars.

Here is a jsbin demonstrating my issue: http://jsbin.com/mofoxijuse/12/edit?html,css,js,console,output

I also tried to pass a stars can.List into the can.view call as the data argument, but I get the error: ‘source.replace is not a function’.

Any ideas?

Thanks,
Alex

The list of stars was the same for every component. I used the define plugin to make sure every stars property points to a different instance.

Justin, Thanks a lot for the quick reply. That did it!

This includes an explanation on why CanJS works this way: https://github.com/canjs/canjs/issues/2443#issuecomment-235735628