I’m playing with Backbone and am getting one model rendered 4 extra times in my list view.
I create and fetch the collection before calling history.start but I don’t think that has to do with it.
I’m calling against an api that is only returning 2 models in json. The first model rendered shows up just once and the next shows 5 times in a row. This happens every time.
Here’s my code.
On line 66 you have this line:
That gets called each time you render a service provider. Due to the generic selector,
div, I think it’s selecting everydivthat exists in the element. When you add the first entry, the onlydivthat exists is<div class='providers'>. However, when it’s rendering the second entry it’s selecting thatdivand all newdiv‘s created by the first service provider and appended to the template.Try something like this: