Skip to content

Consider converting attributes with dashes into to camelCased properties #193

Description

@sorvell

If an attribute is setup for a custom element that has a dash ('-') in it, it's reflected to a property with the same name. This makes referencing the value cumbersome since this['..'] notation must be used. Additionally, the property cannot be used as a binding value for mdv.

We could document that attributes with dashes are not supported.

However, we may want to convert these attributes to camelCased properties: an attribute "foo-bar" to a property "fooBar."

See feedback in https://groups.google.com/forum/#!topic/polymer-dev/GWzc8zekb-o

cc @ebidel

Activity

  1. michaelsbradleyjr commented on Jul 4, 2013

    @michaelsbradleyjr

    +1 for auto-conversion or some workaround that allows attributes with dashes while preserving mdv binding and the firing of ..Changed methods.

  2. dfreedm commented on Jul 24, 2013

    @dfreedm
    Member

    If we have auto camelCased properties, maybe #142 should be supported by this mechanism as well?

  3. sorvell commented on Oct 2, 2013

    @sorvell
    ContributorAuthor

    Dup of #150

  4. kaleb commented on Apr 11, 2014

    @kaleb

    It took me a lot of debugging to realize that this was not supported.

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