{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/11864","labels_url":"https://api.github.com/repos/angular/angular.js/issues/11864/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/11864/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/11864/events","html_url":"https://github.com/angular/angular.js/issues/11864","id":75972623,"number":11864,"title":"Send event only to targeted directive","user":{"login":"junajan","id":1090382,"avatar_url":"https://avatars.githubusercontent.com/u/1090382?v=3","gravatar_id":"","url":"https://api.github.com/users/junajan","html_url":"https://github.com/junajan","followers_url":"https://api.github.com/users/junajan/followers","following_url":"https://api.github.com/users/junajan/following{/other_user}","gists_url":"https://api.github.com/users/junajan/gists{/gist_id}","starred_url":"https://api.github.com/users/junajan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junajan/subscriptions","organizations_url":"https://api.github.com/users/junajan/orgs","repos_url":"https://api.github.com/users/junajan/repos","events_url":"https://api.github.com/users/junajan/events{/privacy}","received_events_url":"https://api.github.com/users/junajan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-13T12:44:41Z","updated_at":"2015-05-13T17:41:20Z","closed_at":null,"body":"It would be great to have some tool to send events only to specific directive, something like:\r\n```javascript\r\n $directive(\"timeAgo\").$event(\"hearthbeat\", new Date().getTime());\r\n```\r\nUsecase example: I have one service, which translates dates to more human readable format like \"one second ago\". In view, there is directive which is calling this service for translation but if I want to update translations in time I have to use $interval in each instance of directive or $broadcast hearthbeat to rootScope and listen on it with directives.. "},"comment":{"url":"https://api.github.com/repos/angular/angular.js/issues/comments/101755722","html_url":"https://github.com/angular/angular.js/issues/11864#issuecomment-101755722","issue_url":"https://api.github.com/repos/angular/angular.js/issues/11864","id":101755722,"user":{"login":"junajan","id":1090382,"avatar_url":"https://avatars.githubusercontent.com/u/1090382?v=3","gravatar_id":"","url":"https://api.github.com/users/junajan","html_url":"https://github.com/junajan","followers_url":"https://api.github.com/users/junajan/followers","following_url":"https://api.github.com/users/junajan/following{/other_user}","gists_url":"https://api.github.com/users/junajan/gists{/gist_id}","starred_url":"https://api.github.com/users/junajan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junajan/subscriptions","organizations_url":"https://api.github.com/users/junajan/orgs","repos_url":"https://api.github.com/users/junajan/repos","events_url":"https://api.github.com/users/junajan/events{/privacy}","received_events_url":"https://api.github.com/users/junajan/received_events","type":"User","site_admin":false},"created_at":"2015-05-13T17:41:20Z","updated_at":"2015-05-13T17:41:20Z","body":"But it would perform computation (selecting translation code based on timediff) every digest cycle.. \r\n\r\nFinally I managed it with service which $emits each 10 000ms hearthbeat event to $rootScope and directives that are listening on this and in case of destruction removes its listeners. But it is messing $rootScope and filter approach would be much prettier.. "}}