You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Within HTML, there might be an element that contains lots of data-binds for, say, a User, and another element that contains lots of data-binds for an Order.
The User's element might have things like "id" or "name" as bind keys, which would clash with the data within an Order.
When using bindData(), it's still really useful to refer to the direct fields of the entities (rather than changing the keys to orderId, orderName, userId, userName, etc.), so the developer has to pass a element context wherever there might be a clash.
As an improvement, an attribute like data-bind-prefix="user" could be added to the outer element, and a special character can be added to the bind key, such as data-bind:text="^id" to indicate that the key should be transformed to "userId", or data-bind:text="_id" for "user_id", for example.
The text was updated successfully, but these errors were encountered:
Within HTML, there might be an element that contains lots of data-binds for, say, a User, and another element that contains lots of data-binds for an Order.
The User's element might have things like "id" or "name" as bind keys, which would clash with the data within an Order.
When using
bindData()
, it's still really useful to refer to the direct fields of the entities (rather than changing the keys to orderId, orderName, userId, userName, etc.), so the developer has to pass a element context wherever there might be a clash.As an improvement, an attribute like
data-bind-prefix="user"
could be added to the outer element, and a special character can be added to the bind key, such asdata-bind:text="^id"
to indicate that the key should be transformed to "userId", ordata-bind:text="_id"
for "user_id", for example.The text was updated successfully, but these errors were encountered: