{"action":"opened","issue":{"url":"https://api.github.com/repos/angular/angular/issues/8610","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/8610/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/8610/comments","events_url":"https://api.github.com/repos/angular/angular/issues/8610/events","html_url":"https://github.com/angular/angular/issues/8610","id":154414687,"number":8610,"title":"Problem with @Directive","user":{"login":"ardf69","id":1520313,"avatar_url":"https://avatars.githubusercontent.com/u/1520313?v=3","gravatar_id":"","url":"https://api.github.com/users/ardf69","html_url":"https://github.com/ardf69","followers_url":"https://api.github.com/users/ardf69/followers","following_url":"https://api.github.com/users/ardf69/following{/other_user}","gists_url":"https://api.github.com/users/ardf69/gists{/gist_id}","starred_url":"https://api.github.com/users/ardf69/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ardf69/subscriptions","organizations_url":"https://api.github.com/users/ardf69/orgs","repos_url":"https://api.github.com/users/ardf69/repos","events_url":"https://api.github.com/users/ardf69/events{/privacy}","received_events_url":"https://api.github.com/users/ardf69/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-12T07:25:30Z","updated_at":"2016-05-12T07:25:30Z","closed_at":null,"body":"I was playing with angular 2.0.0-beta.15 and polymer and it works well but I found a bug (not blocking) with @Directive.\r\nIn a my template there is a code like this\r\n\r\n<paper-tabs selected=\"0\">\r\n    <paper-tab>test1</paper-tab>\r\n   ...\r\n    <paper-tab>testn</paper-tab>\r\n</paper-tabs>\r\n\r\nand as a glue (to map polymer change events to angular change events) I use\r\n\r\n@Directive({\r\n    selector: 'paper-tabs',\r\n    host: {\r\n        '(selected-changed)': 'selectedChange.next($event.target.selected)'\r\n    }\r\n})\r\nexport class PaperTabsGlue {\r\n    @Output() selectedChange:EventEmitter<any> = new EventEmitter();\r\n}\r\n\r\nIf I run the code it gives me the error:\r\n\r\nbrowser_adapter.ts:73 EXCEPTION: Attempt to use a dehydrated detector: ContentComponent_0 -> selected-changed\r\n\r\nThe problem is that polymer start to dispatch an selected-changed event before the PaperTabsGlue directive is ready. All the other selected-changed events are correctly handled.\r\nA workaround is to write the template as\r\n\r\n<paper-tabs [selected]=\"mySelectModel\">\r\n    <paper-tab>test1</paper-tab>\r\n   ...\r\n    <paper-tab>testn</paper-tab>\r\n</paper-tabs>\r\n\r\nCiao Angelo"}}