{"action":"closed","issue":{"url":"https://api.github.com/repos/angular/angular/issues/3671","labels_url":"https://api.github.com/repos/angular/angular/issues/3671/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/3671/comments","events_url":"https://api.github.com/repos/angular/angular/issues/3671/events","html_url":"https://github.com/angular/angular/issues/3671","id":101296099,"number":3671,"title":"Host vs HostListener mixup in Documeantation and Neither Seem to Work","user":{"login":"IAPark","id":8291467,"avatar_url":"https://avatars.githubusercontent.com/u/8291467?v=3","gravatar_id":"","url":"https://api.github.com/users/IAPark","html_url":"https://github.com/IAPark","followers_url":"https://api.github.com/users/IAPark/followers","following_url":"https://api.github.com/users/IAPark/following{/other_user}","gists_url":"https://api.github.com/users/IAPark/gists{/gist_id}","starred_url":"https://api.github.com/users/IAPark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IAPark/subscriptions","organizations_url":"https://api.github.com/users/IAPark/orgs","repos_url":"https://api.github.com/users/IAPark/repos","events_url":"https://api.github.com/users/IAPark/events{/privacy}","received_events_url":"https://api.github.com/users/IAPark/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-16T20:27:37Z","updated_at":"2015-08-17T13:50:38Z","closed_at":"2015-08-17T13:50:38Z","body":"I'm confused after trying to set up listeners for a component I'm playing with. I did some digging in the source as there is no documentation yet for the host parameter in the Component annotation and didn't find anything useful, but I did find an instance where documentation has not be updated to fit with changing names. Additionally, I will include my problem as it may be an actual bug rather than a problem with my code.\r\n\r\nFirst the problem with the documentation:\r\n\r\nThe documentation on angular.io for the [DirectiveAnnotation](https://angular.io/docs/js/latest/api/annotations/DirectiveAnnotation-class.html) in which they reference a `hostListeners` argument. This seems to no longer exist and seems to have been replaced with the `host` argument.\r\n\r\nHere's a snip it of that example code:\r\n\r\n    hostListeners: {\r\n        'onmouseenter': 'onMouseEnter()',\r\n        'onmouseleave': 'onMouseLeave()'\r\n    }\r\n\r\nAnd my problem:\r\n\r\nedit: @ericmartinezr has solved this. The fault was as I suspected on my end.\r\n\r\nI'm trying to use the `host` argument not in a `DirectiveAnnotation`, but in a `ComponentAnnotation`. Here's a stripped down example of what I'm trying to do:\r\n\r\n    /// <reference path=\"../typings/angular2/angular2.d.ts\" />\r\n    \r\n    import {Component, View} from 'angular2/angular2';\r\n    \r\n    enum Direction{\r\n        up_down,\r\n        left_right\r\n    }\r\n\r\n    @Component({\r\n        selector: 'draggable',\r\n        host: {\r\n            'onmousedown': 'dragging_start()'\r\n        }\r\n    })\r\n    @View({\r\n        template: `<div>\r\n                        <p>test</p>\r\n                        <content></content>\r\n                    </div>`\r\n    })\r\n    / / Component controller\r\n    export class Draggable {\r\n        dragging: boolean;\r\n        constructor() {\r\n            this.dragging = false;\r\n        }\r\n\r\n        dragging_start(){\r\n            console.log(\"dragging was enabled\");\r\n            this.dragging = true\r\n        }\r\n    }\r\n\r\nThis renders fine and I would expect to get `dragging was enabled` printed every time I click. Instead, I am getting a `Uncaught ReferenceError: dragging_start is not defined` exception every time I press the mouse down."}}