knockout / tko

🥊 Technical Knockout – The Monorepo for Knockout.js (4.0+)
http://www.tko.io
Other
275 stars 34 forks source link

Inconsistent error messages when using multiple bindings #112

Open tscpp opened 4 years ago

tscpp commented 4 years ago

When using multiple bindings in the same data-bind expression, we get different error messages if we have/have not child bindings.

<span data-bind="let: { item: 'bla' }, foreach: ['1', '2']">
    <span data-bind="text: item"></span>
</span>

Vs.

<span data-bind="let: { item: 'bla' }, foreach: ['1', '2']">

</span>

In the first case, we get an error on the text-binding. In the latter case, we get a clear warning that we shouldn't use multiple bindings.

Unfortunately, the first case is likely to be used most of the time.

Example jsfiddle