{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/polymer-dart/issues/530","labels_url":"https://api.github.com/repos/dart-lang/polymer-dart/issues/530/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/polymer-dart/issues/530/comments","events_url":"https://api.github.com/repos/dart-lang/polymer-dart/issues/530/events","html_url":"https://github.com/dart-lang/polymer-dart/issues/530","id":93397705,"number":530,"title":"serialize/deserialize unavailable in PolymerElement","user":{"login":"donny-dont","id":666297,"avatar_url":"https://avatars.githubusercontent.com/u/666297?v=3","gravatar_id":"","url":"https://api.github.com/users/donny-dont","html_url":"https://github.com/donny-dont","followers_url":"https://api.github.com/users/donny-dont/followers","following_url":"https://api.github.com/users/donny-dont/following{/other_user}","gists_url":"https://api.github.com/users/donny-dont/gists{/gist_id}","starred_url":"https://api.github.com/users/donny-dont/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donny-dont/subscriptions","organizations_url":"https://api.github.com/users/donny-dont/orgs","repos_url":"https://api.github.com/users/donny-dont/repos","events_url":"https://api.github.com/users/donny-dont/events{/privacy}","received_events_url":"https://api.github.com/users/donny-dont/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dart-lang/polymer-dart/labels/1.0-migration","name":"1.0-migration","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-06T23:06:13Z","updated_at":"2015-07-08T20:34:11Z","closed_at":null,"body":"In 1.0 and back to 0.5 you could use serialize/deserialize to handle custom types. This is present in Polymer 1.0, http://polymer.github.io/polymer/ for the base.\r\n\r\n    enum Direction { horizontal, vertical }\r\n    class SelectionGroup {\r\n      @override\r\n      Object deserializeValue(String value, Object currentValue, dynamic type) {\r\n        return (currentValue is Direction)\r\n            ? deserializeDirection(value)\r\n            : super.deserializeValue(value, currentValue, type);\r\n      }\r\n\r\n      @override\r\n      String serializeValue(Object value) {\r\n        return (value is Direction)\r\n            ? serializeDirection(value)\r\n            : super.serializeValue(value);\r\n      }\r\n    }\r\n\r\nDoing this is currently unavailable in the 0.17 branch."},"comment":{"url":"https://api.github.com/repos/dart-lang/polymer-dart/issues/comments/119723712","html_url":"https://github.com/dart-lang/polymer-dart/issues/530#issuecomment-119723712","issue_url":"https://api.github.com/repos/dart-lang/polymer-dart/issues/530","id":119723712,"user":{"login":"jakemac53","id":984921,"avatar_url":"https://avatars.githubusercontent.com/u/984921?v=3","gravatar_id":"","url":"https://api.github.com/users/jakemac53","html_url":"https://github.com/jakemac53","followers_url":"https://api.github.com/users/jakemac53/followers","following_url":"https://api.github.com/users/jakemac53/following{/other_user}","gists_url":"https://api.github.com/users/jakemac53/gists{/gist_id}","starred_url":"https://api.github.com/users/jakemac53/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakemac53/subscriptions","organizations_url":"https://api.github.com/users/jakemac53/orgs","repos_url":"https://api.github.com/users/jakemac53/repos","events_url":"https://api.github.com/users/jakemac53/events{/privacy}","received_events_url":"https://api.github.com/users/jakemac53/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T20:34:11Z","updated_at":"2015-07-08T20:34:11Z","body":"Actually I like that idea, seems reasonable."}}