{"action":"opened","issue":{"url":"https://api.github.com/repos/lumapps/lumX/issues/235","labels_url":"https://api.github.com/repos/lumapps/lumX/issues/235/labels{/name}","comments_url":"https://api.github.com/repos/lumapps/lumX/issues/235/comments","events_url":"https://api.github.com/repos/lumapps/lumX/issues/235/events","html_url":"https://github.com/lumapps/lumX/issues/235","id":65535713,"number":235,"title":"Changing tabs re-creates directives without raising $destroy","user":{"login":"sondreb","id":309938,"avatar_url":"https://avatars.githubusercontent.com/u/309938?v=3","gravatar_id":"","url":"https://api.github.com/users/sondreb","html_url":"https://github.com/sondreb","followers_url":"https://api.github.com/users/sondreb/followers","following_url":"https://api.github.com/users/sondreb/following{/other_user}","gists_url":"https://api.github.com/users/sondreb/gists{/gist_id}","starred_url":"https://api.github.com/users/sondreb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sondreb/subscriptions","organizations_url":"https://api.github.com/users/sondreb/orgs","repos_url":"https://api.github.com/users/sondreb/repos","events_url":"https://api.github.com/users/sondreb/events{/privacy}","received_events_url":"https://api.github.com/users/sondreb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-31T20:13:04Z","updated_at":"2015-03-31T20:13:04Z","closed_at":null,"body":"I have a lx-tabs control in a page where I have a custom directive within each of the tabs. I have verified that the controller and the link function are both called whenever I switch tabs. This means it re-creates the content somehow, yet without raising $destroy, which is a concern of mine.\r\n\r\nWhen I navigate away from the current page (and controller), then $destroy is raised on the child directive and my directive is able to release resources. Yet if I change back and forth between tabs, I have a memory leak as each time a new directive instance is created, which loads some resources I need to release.\r\n\r\nIs there some event or trigger I can implement in the directive or the tabs? Is there a way I can avoid re-creating the directive within the tabs when navigating? That would actually be the best behavior, as the user wouldn't have to load a lot of resources if they simply want to switch quickly between two tabs."}}