{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/12355","labels_url":"https://api.github.com/repos/angular/angular.js/issues/12355/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/12355/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/12355/events","html_url":"https://github.com/angular/angular.js/issues/12355","id":95233225,"number":12355,"title":"Updating directive definition","user":{"login":"bukharin","id":3126568,"avatar_url":"https://avatars.githubusercontent.com/u/3126568?v=3","gravatar_id":"","url":"https://api.github.com/users/bukharin","html_url":"https://github.com/bukharin","followers_url":"https://api.github.com/users/bukharin/followers","following_url":"https://api.github.com/users/bukharin/following{/other_user}","gists_url":"https://api.github.com/users/bukharin/gists{/gist_id}","starred_url":"https://api.github.com/users/bukharin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bukharin/subscriptions","organizations_url":"https://api.github.com/users/bukharin/orgs","repos_url":"https://api.github.com/users/bukharin/repos","events_url":"https://api.github.com/users/bukharin/events{/privacy}","received_events_url":"https://api.github.com/users/bukharin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-15T16:17:23Z","updated_at":"2015-07-16T09:59:55Z","closed_at":"2015-07-16T09:59:55Z","body":"I try to implement live updating of angularjs application, that user can modify directive definition (controller, template, bindings...) and it has been re-rendered at the page automatically,  without reloading the page (through nodejs + websockets + chrome extention)\r\n\r\nThe purpose is update existing definition of directive that has been rendered at the page. I have done with template, but can't achieve with controller and other directive definition properties. It seems that it's impossible in current angularJs implementation.\r\n\r\nI found that `directive` method register `name + \"Directive\"`factory. I tried to register the directive as factory direct but `directive` method also register it in  in `hasDirectives` private variable (https://github.com/angular/angular.js/blob/master/src/ng/compile.js#L726) that checks on compile time. Also injector caches the factory result in the internal cache object.\r\n\r\nIt would be nice to see an api for updating existing directive defintion objects, like:\r\n\r\n```\r\n$compile.updateDirective(name, newDirectiveDefinitionObject);\r\n```\r\n\r\nI experiment and found to achieve this we need:\r\n\r\n- register new `name + \"Directive\"`factory\r\n- drop injector cache for `name + \"Directive\"`"},"comment":{"url":"https://api.github.com/repos/angular/angular.js/issues/comments/121914059","html_url":"https://github.com/angular/angular.js/issues/12355#issuecomment-121914059","issue_url":"https://api.github.com/repos/angular/angular.js/issues/12355","id":121914059,"user":{"login":"lgalfaso","id":391394,"avatar_url":"https://avatars.githubusercontent.com/u/391394?v=3","gravatar_id":"","url":"https://api.github.com/users/lgalfaso","html_url":"https://github.com/lgalfaso","followers_url":"https://api.github.com/users/lgalfaso/followers","following_url":"https://api.github.com/users/lgalfaso/following{/other_user}","gists_url":"https://api.github.com/users/lgalfaso/gists{/gist_id}","starred_url":"https://api.github.com/users/lgalfaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgalfaso/subscriptions","organizations_url":"https://api.github.com/users/lgalfaso/orgs","repos_url":"https://api.github.com/users/lgalfaso/repos","events_url":"https://api.github.com/users/lgalfaso/events{/privacy}","received_events_url":"https://api.github.com/users/lgalfaso/received_events","type":"User","site_admin":false},"created_at":"2015-07-16T09:59:55Z","updated_at":"2015-07-16T09:59:55Z","body":"An automatic reload mechanism to make development faster at the expense of a larger codebase for everybody is not something very interesting. Until there is some explanation that shows how this would work, I do not think there is anything actionable here. If you would like to build a proposal, then please create a doc explaining it (please do not start with a PR, start with a doc) and send it to the devs mailing list."}}