Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple binds? #98

Closed
texdc opened this issue Jan 11, 2013 · 1 comment
Closed

Multiple binds? #98

texdc opened this issue Jan 11, 2013 · 1 comment

Comments

@texdc
Copy link

texdc commented Jan 11, 2013

I'm evaluating agility and have a couple questions:

  • How to bind multiple properties to a single DOM element?
<nav data-bind="menus" data-bind="id=name" />
<!-- OR... -->
<nav data-bind="menus id=name" />
  • How to handle properties that are arrays?
var nav = $$({
    model: {name: '', menus: []},
    view: $("#tpl-nav").html()
});
@phonovision
Copy link

How to bind multiple properties to a single DOM element?

The second one should work if you use a comma as seperator:

<nav data-bind="menus, id=name" />

See also #63

How to handle properties that are arrays?

The only way I know is to iterate throug the array, for example by a controller method. If someone knows a better option I would appreciate it ;-)

@texdc texdc closed this as completed Oct 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants