{"action":"created","issue":{"url":"https://api.github.com/repos/Polymer/polymer/issues/1226","labels_url":"https://api.github.com/repos/Polymer/polymer/issues/1226/labels{/name}","comments_url":"https://api.github.com/repos/Polymer/polymer/issues/1226/comments","events_url":"https://api.github.com/repos/Polymer/polymer/issues/1226/events","html_url":"https://github.com/Polymer/polymer/issues/1226","id":59109789,"number":1226,"title":"[0.8] Consider always assigning to native properties","user":{"login":"ssorallen","id":29612,"avatar_url":"https://avatars.githubusercontent.com/u/29612?v=3","gravatar_id":"","url":"https://api.github.com/users/ssorallen","html_url":"https://github.com/ssorallen","followers_url":"https://api.github.com/users/ssorallen/followers","following_url":"https://api.github.com/users/ssorallen/following{/other_user}","gists_url":"https://api.github.com/users/ssorallen/gists{/gist_id}","starred_url":"https://api.github.com/users/ssorallen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssorallen/subscriptions","organizations_url":"https://api.github.com/users/ssorallen/orgs","repos_url":"https://api.github.com/users/ssorallen/repos","events_url":"https://api.github.com/users/ssorallen/events{/privacy}","received_events_url":"https://api.github.com/users/ssorallen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Polymer/polymer/labels/0.8","name":"0.8","color":"00aa44"}],"state":"open","locked":false,"assignee":{"login":"sorvell","id":78891,"avatar_url":"https://avatars.githubusercontent.com/u/78891?v=3","gravatar_id":"","url":"https://api.github.com/users/sorvell","html_url":"https://github.com/sorvell","followers_url":"https://api.github.com/users/sorvell/followers","following_url":"https://api.github.com/users/sorvell/following{/other_user}","gists_url":"https://api.github.com/users/sorvell/gists{/gist_id}","starred_url":"https://api.github.com/users/sorvell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sorvell/subscriptions","organizations_url":"https://api.github.com/users/sorvell/orgs","repos_url":"https://api.github.com/users/sorvell/repos","events_url":"https://api.github.com/users/sorvell/events{/privacy}","received_events_url":"https://api.github.com/users/sorvell/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-02-26T17:43:56Z","updated_at":"2015-03-03T01:51:55Z","closed_at":null,"body":"Currently the effect of the left side of an assignment is determined by the value on the right side. If the right side contains a binding, i.e. it's wrapped in `[[]]` or `{{}}`, the left side is treated as a *property* assignment. If the right side contains no binding, the left side is treated as an *attribute* assignment.\r\n\r\nThis behavior forces the developer to alter assignments based on whether binding is happening or not and leads to an inconsistent API. For example:\r\n\r\n**Currently:**\r\n\r\n```html\r\n<!-- attribute assignment -->\r\n<div data-bar=\"baz\"></div>\r\n<div class-name=\"foo\"></div>\r\n<label html-for=\"bar\"></label>\r\n\r\n<!-- camel case translated property assignment -->\r\n<label html-for=\"{{bah}}\"></label>\r\n<div class-name=\"{{bar}}\"></div>\r\n```\r\n\r\nFor any assignment that would result in writing to a native property, it would be more consistent to always make the assignment to the property. Non-native / custom / `data-` prefixed assignments should likely not be affected.\r\n\r\n**Proposed:**\r\n\r\n```html\r\n<!-- attribute assignment -->\r\n<div data-bar=\"baz\"></div>\r\n\r\n<!-- camel case translated property assignment -->\r\n<div class-name=\"foo\"></div>\r\n<label html-for=\"bar\"></div>\r\n<label html-for=\"{{bah}}\"></label>\r\n<div class-name=\"{{bar}}\"></div>\r\n```"},"comment":{"url":"https://api.github.com/repos/Polymer/polymer/issues/comments/76871547","html_url":"https://github.com/Polymer/polymer/issues/1226#issuecomment-76871547","issue_url":"https://api.github.com/repos/Polymer/polymer/issues/1226","id":76871547,"user":{"login":"ssorallen","id":29612,"avatar_url":"https://avatars.githubusercontent.com/u/29612?v=3","gravatar_id":"","url":"https://api.github.com/users/ssorallen","html_url":"https://github.com/ssorallen","followers_url":"https://api.github.com/users/ssorallen/followers","following_url":"https://api.github.com/users/ssorallen/following{/other_user}","gists_url":"https://api.github.com/users/ssorallen/gists{/gist_id}","starred_url":"https://api.github.com/users/ssorallen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssorallen/subscriptions","organizations_url":"https://api.github.com/users/ssorallen/orgs","repos_url":"https://api.github.com/users/ssorallen/repos","events_url":"https://api.github.com/users/ssorallen/events{/privacy}","received_events_url":"https://api.github.com/users/ssorallen/received_events","type":"User","site_admin":false},"created_at":"2015-03-03T01:51:55Z","updated_at":"2015-03-03T01:51:55Z","body":"This leads to inconsistent behaviour with `data-` properties as well. Consider:\r\n\r\n```html\r\n<!-- The value is available at `element.dataset.foo` -->\r\n<x-x data-foo=\"bar\"></x-x>\r\n\r\n<!-- The value is available at `element.dataFoo` -->\r\n<x-x data-foo=\"{{bar}}\"></x-x>\r\n```"}}