Closed rafaelw closed 11 years ago
I think a more important question is what should happen when you iterator over [0, 1, undefined, 3]. I expect 4 items.
I'm asking mainly because the behavior of still troubles me a bit. In particular, with a , assigning any value (even undefined) to template.model creates an instance, and there's no way to tell the template element to remove it.
What do you mean that there is no way to tell the template to remove the item?
I guess what I'm getting at is there it seems like strange API that
template.model = {}
can create an instance (via. <template bind>
), which cannot be removed via template.model (like template.model = undefined).
You can remove the instance in this case with template.unbind('bind'), it's just kind of a weird API.
BTW, Right now (@arv, in your example), you will get 4 instances. I was suggesting that you might get 3. Sounds like you don't like that. Thinking more about it, I'm not sure I like it either. It's not really the iteration case that bothers me, it's the single-instantiation case.
Closing this. Pretty much no one thinks it's a good idea.
e.g.
<template repeat>
bound to [undefined, undefined, undefined].Right now, the semantics are that an instance is created regardless of the model value.
I'm asking mainly because the behavior of
<template bind>
still troubles me a bit. In particular, with a<template bind>
, assigning any value (even undefined) to template.model creates an instance, and there's no way to tell the template element to remove it.