{"action":"created","issue":{"url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/75","labels_url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/75/comments","events_url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/75/events","html_url":"https://github.com/jtblin/angular-chart.js/issues/75","id":60257232,"number":75,"title":"Issues when using chart.js with leaflet","user":{"login":"sebastialonso","id":3493453,"avatar_url":"https://avatars.githubusercontent.com/u/3493453?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastialonso","html_url":"https://github.com/sebastialonso","followers_url":"https://api.github.com/users/sebastialonso/followers","following_url":"https://api.github.com/users/sebastialonso/following{/other_user}","gists_url":"https://api.github.com/users/sebastialonso/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastialonso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastialonso/subscriptions","organizations_url":"https://api.github.com/users/sebastialonso/orgs","repos_url":"https://api.github.com/users/sebastialonso/repos","events_url":"https://api.github.com/users/sebastialonso/events{/privacy}","received_events_url":"https://api.github.com/users/sebastialonso/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jtblin/angular-chart.js/labels/repro%20needed","name":"repro needed","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-03-08T13:45:08Z","updated_at":"2015-04-30T12:57:48Z","closed_at":"2015-04-25T07:48:22Z","body":"I'm using leaflet in my project, but not in this particular controller, where I am using `chart.js`.\r\n\r\nIf I use the `legend` attribute, this errors comes up\r\n\r\n~~~\r\nError: [$compile:ctreq] Controller 'leaflet', required by directive 'legend', can't be found!\r\n~~~\r\n[link for the error](https://docs.angularjs.org/error/$compile/ctreq?p0=leaflet&p1=legend)\r\n\r\nI believe it might be a naming conflict."},"comment":{"url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/comments/97765431","html_url":"https://github.com/jtblin/angular-chart.js/issues/75#issuecomment-97765431","issue_url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/75","id":97765431,"user":{"login":"deancsmith","id":387289,"avatar_url":"https://avatars.githubusercontent.com/u/387289?v=3","gravatar_id":"","url":"https://api.github.com/users/deancsmith","html_url":"https://github.com/deancsmith","followers_url":"https://api.github.com/users/deancsmith/followers","following_url":"https://api.github.com/users/deancsmith/following{/other_user}","gists_url":"https://api.github.com/users/deancsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/deancsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deancsmith/subscriptions","organizations_url":"https://api.github.com/users/deancsmith/orgs","repos_url":"https://api.github.com/users/deancsmith/repos","events_url":"https://api.github.com/users/deancsmith/events{/privacy}","received_events_url":"https://api.github.com/users/deancsmith/received_events","type":"User","site_admin":false},"created_at":"2015-04-30T12:57:48Z","updated_at":"2015-04-30T12:57:48Z","body":"My hacky workaround was to just generate the HTML using the Chart.js methods, and then inject the legend into the DOM in the correct place.\r\n\r\n\r\nIn the controller:\r\n```\r\n// Catch the chart creation event\r\n$scope.$on('create', function (event, chart) {\r\n    $scope.legend = $sce.trustAsHtml(chart.generateLegend());\r\n});\r\n```\r\n\r\nIn the view:\r\n```\r\n<span ng-bind-html=\"legend\">{{ legend }}</span>\r\n```"}}