Skip to content

bind attribute replacement #1790

Closed
Closed
@winhowes

Description

Hi, I'm aware the bind attribute has been disabled on <template>s but after pouring through the docs on polymer-project.org, stackoverflow.com and the polymer source code I'm not sure how to port the same functionality to Polymer 1.0. As I understand it the bind attribute allows you to scope to properties inside of a template.

So with this code snippet I would expect name to become "test" (if bind was ported from Polymer 0.5), but I'm not sure how to apply this scoping in Polymer 1.0. I know I could just do {{data.name}} but unfortunately my use case is a bit more complex and that won't work. Could you please advise on how to achieve this? My element is supposed to be a file treeview, which either requires an indefinite number of dom-repeats or scoping like this.

<dom-module is="example-elem">
  <template>
      <template bind="{{data}}">
        <div>{{name}}</div>
      </template>
  </template>
</dom-module>

<script>
Polymer({

    is: 'example-elem',

    properties: {
      data: {
        type: Object,
        value: {
           name: "test"
        }
      }
    }
}
</script>

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions