ajklein/webkit

need the ability to reference "this" and ancestor values within bindings

rafaelw opened this issue · 1 comments

It may be that this is left to delegates to implement, but if so, we need tests showing that it is possible.

I don't think either of these is possible with delegates as currently implemented. For "this", we'd need the delegate protocol to accept the empty path, so we might as well just implement that in MDV ourselves (unless we want to explicitly punt on syntax). For "ancestor", we'd need the ability for the delegate to pass back an object from which to start observing, since right now the paths are assumed to be relative to the model at the point where the curlies appeared.

We probably want to allow the delegate to specify a different model anyway, but that falls more under "design delegate pattern" than "provide access to ancestor", and since the DOM is already in the business of creating model "scopes", seems like we should provide some way to access them too. So I'd argue these both should be implemented natively, not in the delegate.