{"action":"opened","issue":{"url":"https://api.github.com/repos/krescruz/angular-materialize/issues/136","repository_url":"https://api.github.com/repos/krescruz/angular-materialize","labels_url":"https://api.github.com/repos/krescruz/angular-materialize/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/krescruz/angular-materialize/issues/136/comments","events_url":"https://api.github.com/repos/krescruz/angular-materialize/issues/136/events","html_url":"https://github.com/krescruz/angular-materialize/issues/136","id":141591069,"number":136,"title":"Element recompilation may break 3rd party directives","user":{"login":"svvac","id":129217,"avatar_url":"https://avatars.githubusercontent.com/u/129217?v=3","gravatar_id":"","url":"https://api.github.com/users/svvac","html_url":"https://github.com/svvac","followers_url":"https://api.github.com/users/svvac/followers","following_url":"https://api.github.com/users/svvac/following{/other_user}","gists_url":"https://api.github.com/users/svvac/gists{/gist_id}","starred_url":"https://api.github.com/users/svvac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svvac/subscriptions","organizations_url":"https://api.github.com/users/svvac/orgs","repos_url":"https://api.github.com/users/svvac/repos","events_url":"https://api.github.com/users/svvac/events{/privacy}","received_events_url":"https://api.github.com/users/svvac/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-17T13:59:30Z","updated_at":"2016-03-17T13:59:30Z","closed_at":null,"body":"Hi all.\r\n\r\nI'm using a custom directives that heavily relies on `$compile` for its workings to dynamically add other directives to an element. However, when used in conjunction with the `dropdown` directive you supply, conditions (i.e. `ng-if`and kin) completely stopped working. When printing the condition in a template block, it evaluated to `true`, but the element wouldn't show up.\r\n\r\nI finally found the culprit in the `$compile` call you do in the link phase: it forced the element to be recompiled in the isolated scope you use for the directive, hence breaking all references to my locals. Removing it did the trick.\r\n\r\nBut why do you recompile the element at all? All you need is to call the `.dropdown()` init function that setups the intended behavior, but since that is in jQuery world, it does not require Angular to recompile the element. Am I missing something, or is it useless indeed?"}}