SteveSanderson/knockout — Issue #342: Add $templateData to all contexts below a bound template
Author: contentfree
Created: 2012-02-24 08:12:43+00:00
State: open

It would be very useful to have another context variable called $templateData that always pointed to the data given in an ancestors template binding. For example, imagine this nested setup:

It would be useful and more readable to be able to, at this nested level, reference `$templateData.someVar` instead of `$parents[1].someVar`. The former tells you exactly where you're looking, as `$parent` and `$root` do. The latter can get you lost trying to track how many levels you're nested. And it (obviously) gets more complicated if you have additional markup interspersed between the foreachs.