Skip to content

re-organizing binding parameters #2

Description

@mbest

Each binding has a unique name, such as value and text. Bindings generally take a single parameter; for example: text: 'Hello'.

Some binding (options, foreach, template) often take multiple parameters. Currently there are two methods used to specify multiple parameters. 'options' uses multiple top-level bindings (options: list, optionsText: 'name', optionsValue: 'id'), but only 'options' has a binding handler. 'foreach' and 'template' use a sub-object (template: {name: 'me', data: mydata}), but can also be called with a single parameter (template: 'me').

Another class of bindings (css, style, attr, event) also take multiple parameters, but for a different reason. These current accept an object where the property name is the class, style, etc. to be bound to and the value is the dependency for that binding.

I propose that all independent bindings be specified at the top level. If a binding requires multiple parameters, these will specified using a sub object. In the case of bindings that require two parameters (key and value), we'll use a method of combining the binding type with the key, such as style.color: 'blue'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions