Skip to content

Binding not working for open text #1677

Description

@pawelstep

MyCaption = {{caption}}

This above does not work. Currently binding works only for entire attribute or for entire tag content
{{caption}}.

Ideallly, binding should work for any piece of text within DOM, like it was in 0.5

The company {{company}} CEO is {{ceo}}

More, this should work also for CSS customizations (text insertions), and class selectors and inline-style (I know there are other ways to do it, but that was really great in 0.55):
<style>
div {
background-color:{{bkgcolor}}
}
.caption {
color:{{fontcolor}}
}
.caption .level1 {
font-size:10pt;
}
.caption .level2 {
font-size:8pt;
}
.caption .level3 {
font-size:8pt;
}
</style>

My Text

Activity

  1. IntranetFactory commented on May 30, 2015

    @IntranetFactory

    That's by design

    The binding annotation must currently span the entire content of the tag:

    See https://www.polymer-project.org/1.0/docs/devguide/data-binding.html

  2. pawelstep commented on May 30, 2015

    @pawelstep
    Author

    Let me correct the layout :

    MyCaption={{caption}}

    This above does not work. Currently binding works only for entire attribute or for entire tag content e.g.
    {{caption}}

    I've seen already your comment 'that's by design'. It's a pity.
    So please consider the below ones too:

    More, this should work also for:(I know there are other ways to do it, but that was really great in 0.55):

    • CSS customizations (text insertions),
    • class selectors
    • inline-style.

    <style>
    div { background-color:{{bkgcolor}} }
    .caption { color:{{fontcolor}} }
    .caption .level1 { font-size:10pt; }
    .caption .level2 { font-size:8pt; }
    .caption .level3 { font-size:7pt; }
    </style>

    MyText

  3. kevinpschaaf commented on May 30, 2015

    @kevinpschaaf
    Member

    The feature wasn't forgotten, we just didn't quite land that for 1.0, but it's documented on the near-term roadmap.
    https://www.polymer-project.org/1.0/docs/#binding-features

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions