{"action":"closed","number":2,"pull_request":{"url":"https://api.github.com/repos/shotap/sp-pie/pulls/2","id":58047030,"html_url":"https://github.com/shotap/sp-pie/pull/2","diff_url":"https://github.com/shotap/sp-pie/pull/2.diff","patch_url":"https://github.com/shotap/sp-pie/pull/2.patch","issue_url":"https://api.github.com/repos/shotap/sp-pie/issues/2","number":2,"state":"closed","locked":false,"title":"Switch to passing slices with isolate scope","user":{"login":"alexpeattie","id":636814,"avatar_url":"https://avatars.githubusercontent.com/u/636814?v=3","gravatar_id":"","url":"https://api.github.com/users/alexpeattie","html_url":"https://github.com/alexpeattie","followers_url":"https://api.github.com/users/alexpeattie/followers","following_url":"https://api.github.com/users/alexpeattie/following{/other_user}","gists_url":"https://api.github.com/users/alexpeattie/gists{/gist_id}","starred_url":"https://api.github.com/users/alexpeattie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexpeattie/subscriptions","organizations_url":"https://api.github.com/users/alexpeattie/orgs","repos_url":"https://api.github.com/users/alexpeattie/repos","events_url":"https://api.github.com/users/alexpeattie/events{/privacy}","received_events_url":"https://api.github.com/users/alexpeattie/received_events","type":"User","site_admin":false},"body":"Thanks again for the great project :+1:!\r\n\r\nAt the moment, `slices` is fetched by looking for an attribute in the parent scope with the name equal to the directive's `slice` attribute. There are a few limitations with this: the main being that any 'dotted' scope variable will fail. For example when using the [`controllerAs` syntax](https://github.com/johnpapa/angular-styleguide#controlleras-view-syntax) or a nested object:\r\n\r\n```js\r\napp.controller('DashboardController', function() {\r\n  $scope.data = [{ \"value\": 30, \"color\": \"#f06\" }, { \"value\": 70, \"color\": \"blue\" }];\r\n})\r\n\r\napp.controller('AnotherController', function() {\r\n  $scope.nested = { data: { \"value\": 30, \"color\": \"#f06\" }, { \"value\": 70, \"color\": \"blue\" } };\r\n})\r\n```\r\n```html\r\n<div ng-controller='DashboardController as vm'>\r\n  <sp-pie slices='vm.data'></sp-pie>\r\n</div>\r\n\r\n<div ng-controller='AnotherController'>\r\n  <sp-pie slices='nested.data'></sp-pie>\r\n</div>\r\n```\r\n\r\nWe also can't pass a function:\r\n\r\n```js\r\napp.controller('RandController', function() {\r\n  $scope.randomData = function() {\r\n    var randNum = Math.random() * 100;\r\n    return [{ \"value\": randNum, \"color\": \"#f06\" }, { \"value\":  100 - randNum, \"color\": \"blue\" } }];\r\n  }\r\n})\r\n```\r\n\r\n```html\r\n<div ng-controller='RandController'>\r\n  <sp-pie slices='randomData()'></sp-pie>\r\n</div>\r\n```\r\n\r\nThis PR addresses these limitations by switching to using an isolate scope, and passing `slices` in as a scope property rather than an attribute :relaxed:.","created_at":"2016-02-02T20:44:00Z","updated_at":"2016-02-11T14:35:43Z","closed_at":"2016-02-11T14:35:43Z","merged_at":"2016-02-11T14:35:43Z","merge_commit_sha":"efa28eb7ecbe9d4ee9f80b9fadb7634643f45822","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/shotap/sp-pie/pulls/2/commits","review_comments_url":"https://api.github.com/repos/shotap/sp-pie/pulls/2/comments","review_comment_url":"https://api.github.com/repos/shotap/sp-pie/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shotap/sp-pie/issues/2/comments","statuses_url":"https://api.github.com/repos/shotap/sp-pie/statuses/28acd9ef385df3366cfbe5280bdb2849802afd5b","head":{"label":"alexpeattie:master","ref":"master","sha":"28acd9ef385df3366cfbe5280bdb2849802afd5b","user":{"login":"alexpeattie","id":636814,"avatar_url":"https://avatars.githubusercontent.com/u/636814?v=3","gravatar_id":"","url":"https://api.github.com/users/alexpeattie","html_url":"https://github.com/alexpeattie","followers_url":"https://api.github.com/users/alexpeattie/followers","following_url":"https://api.github.com/users/alexpeattie/following{/other_user}","gists_url":"https://api.github.com/users/alexpeattie/gists{/gist_id}","starred_url":"https://api.github.com/users/alexpeattie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexpeattie/subscriptions","organizations_url":"https://api.github.com/users/alexpeattie/orgs","repos_url":"https://api.github.com/users/alexpeattie/repos","events_url":"https://api.github.com/users/alexpeattie/events{/privacy}","received_events_url":"https://api.github.com/users/alexpeattie/received_events","type":"User","site_admin":false},"repo":{"id":50947578,"name":"sp-pie","full_name":"alexpeattie/sp-pie","owner":{"login":"alexpeattie","id":636814,"avatar_url":"https://avatars.githubusercontent.com/u/636814?v=3","gravatar_id":"","url":"https://api.github.com/users/alexpeattie","html_url":"https://github.com/alexpeattie","followers_url":"https://api.github.com/users/alexpeattie/followers","following_url":"https://api.github.com/users/alexpeattie/following{/other_user}","gists_url":"https://api.github.com/users/alexpeattie/gists{/gist_id}","starred_url":"https://api.github.com/users/alexpeattie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexpeattie/subscriptions","organizations_url":"https://api.github.com/users/alexpeattie/orgs","repos_url":"https://api.github.com/users/alexpeattie/repos","events_url":"https://api.github.com/users/alexpeattie/events{/privacy}","received_events_url":"https://api.github.com/users/alexpeattie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexpeattie/sp-pie","description":"AngularJS directive for creating pie charts with SVG","fork":true,"url":"https://api.github.com/repos/alexpeattie/sp-pie","forks_url":"https://api.github.com/repos/alexpeattie/sp-pie/forks","keys_url":"https://api.github.com/repos/alexpeattie/sp-pie/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexpeattie/sp-pie/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexpeattie/sp-pie/teams","hooks_url":"https://api.github.com/repos/alexpeattie/sp-pie/hooks","issue_events_url":"https://api.github.com/repos/alexpeattie/sp-pie/issues/events{/number}","events_url":"https://api.github.com/repos/alexpeattie/sp-pie/events","assignees_url":"https://api.github.com/repos/alexpeattie/sp-pie/assignees{/user}","branches_url":"https://api.github.com/repos/alexpeattie/sp-pie/branches{/branch}","tags_url":"https://api.github.com/repos/alexpeattie/sp-pie/tags","blobs_url":"https://api.github.com/repos/alexpeattie/sp-pie/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexpeattie/sp-pie/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexpeattie/sp-pie/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexpeattie/sp-pie/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexpeattie/sp-pie/statuses/{sha}","languages_url":"https://api.github.com/repos/alexpeattie/sp-pie/languages","stargazers_url":"https://api.github.com/repos/alexpeattie/sp-pie/stargazers","contributors_url":"https://api.github.com/repos/alexpeattie/sp-pie/contributors","subscribers_url":"https://api.github.com/repos/alexpeattie/sp-pie/subscribers","subscription_url":"https://api.github.com/repos/alexpeattie/sp-pie/subscription","commits_url":"https://api.github.com/repos/alexpeattie/sp-pie/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexpeattie/sp-pie/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexpeattie/sp-pie/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexpeattie/sp-pie/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexpeattie/sp-pie/contents/{+path}","compare_url":"https://api.github.com/repos/alexpeattie/sp-pie/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexpeattie/sp-pie/merges","archive_url":"https://api.github.com/repos/alexpeattie/sp-pie/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexpeattie/sp-pie/downloads","issues_url":"https://api.github.com/repos/alexpeattie/sp-pie/issues{/number}","pulls_url":"https://api.github.com/repos/alexpeattie/sp-pie/pulls{/number}","milestones_url":"https://api.github.com/repos/alexpeattie/sp-pie/milestones{/number}","notifications_url":"https://api.github.com/repos/alexpeattie/sp-pie/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexpeattie/sp-pie/labels{/name}","releases_url":"https://api.github.com/repos/alexpeattie/sp-pie/releases{/id}","deployments_url":"https://api.github.com/repos/alexpeattie/sp-pie/deployments","created_at":"2016-02-02T19:54:49Z","updated_at":"2016-02-02T19:54:49Z","pushed_at":"2016-02-02T20:38:26Z","git_url":"git://github.com/alexpeattie/sp-pie.git","ssh_url":"git@github.com:alexpeattie/sp-pie.git","clone_url":"https://github.com/alexpeattie/sp-pie.git","svn_url":"https://github.com/alexpeattie/sp-pie","homepage":null,"size":25,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"shotap:master","ref":"master","sha":"645a6852d9174a5d180ad5495aa55b29aee567cd","user":{"login":"shotap","id":4605350,"avatar_url":"https://avatars.githubusercontent.com/u/4605350?v=3","gravatar_id":"","url":"https://api.github.com/users/shotap","html_url":"https://github.com/shotap","followers_url":"https://api.github.com/users/shotap/followers","following_url":"https://api.github.com/users/shotap/following{/other_user}","gists_url":"https://api.github.com/users/shotap/gists{/gist_id}","starred_url":"https://api.github.com/users/shotap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shotap/subscriptions","organizations_url":"https://api.github.com/users/shotap/orgs","repos_url":"https://api.github.com/users/shotap/repos","events_url":"https://api.github.com/users/shotap/events{/privacy}","received_events_url":"https://api.github.com/users/shotap/received_events","type":"User","site_admin":false},"repo":{"id":37130238,"name":"sp-pie","full_name":"shotap/sp-pie","owner":{"login":"shotap","id":4605350,"avatar_url":"https://avatars.githubusercontent.com/u/4605350?v=3","gravatar_id":"","url":"https://api.github.com/users/shotap","html_url":"https://github.com/shotap","followers_url":"https://api.github.com/users/shotap/followers","following_url":"https://api.github.com/users/shotap/following{/other_user}","gists_url":"https://api.github.com/users/shotap/gists{/gist_id}","starred_url":"https://api.github.com/users/shotap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shotap/subscriptions","organizations_url":"https://api.github.com/users/shotap/orgs","repos_url":"https://api.github.com/users/shotap/repos","events_url":"https://api.github.com/users/shotap/events{/privacy}","received_events_url":"https://api.github.com/users/shotap/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shotap/sp-pie","description":"AngularJS directive for creating pie charts with SVG","fork":false,"url":"https://api.github.com/repos/shotap/sp-pie","forks_url":"https://api.github.com/repos/shotap/sp-pie/forks","keys_url":"https://api.github.com/repos/shotap/sp-pie/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shotap/sp-pie/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shotap/sp-pie/teams","hooks_url":"https://api.github.com/repos/shotap/sp-pie/hooks","issue_events_url":"https://api.github.com/repos/shotap/sp-pie/issues/events{/number}","events_url":"https://api.github.com/repos/shotap/sp-pie/events","assignees_url":"https://api.github.com/repos/shotap/sp-pie/assignees{/user}","branches_url":"https://api.github.com/repos/shotap/sp-pie/branches{/branch}","tags_url":"https://api.github.com/repos/shotap/sp-pie/tags","blobs_url":"https://api.github.com/repos/shotap/sp-pie/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shotap/sp-pie/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shotap/sp-pie/git/refs{/sha}","trees_url":"https://api.github.com/repos/shotap/sp-pie/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shotap/sp-pie/statuses/{sha}","languages_url":"https://api.github.com/repos/shotap/sp-pie/languages","stargazers_url":"https://api.github.com/repos/shotap/sp-pie/stargazers","contributors_url":"https://api.github.com/repos/shotap/sp-pie/contributors","subscribers_url":"https://api.github.com/repos/shotap/sp-pie/subscribers","subscription_url":"https://api.github.com/repos/shotap/sp-pie/subscription","commits_url":"https://api.github.com/repos/shotap/sp-pie/commits{/sha}","git_commits_url":"https://api.github.com/repos/shotap/sp-pie/git/commits{/sha}","comments_url":"https://api.github.com/repos/shotap/sp-pie/comments{/number}","issue_comment_url":"https://api.github.com/repos/shotap/sp-pie/issues/comments{/number}","contents_url":"https://api.github.com/repos/shotap/sp-pie/contents/{+path}","compare_url":"https://api.github.com/repos/shotap/sp-pie/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shotap/sp-pie/merges","archive_url":"https://api.github.com/repos/shotap/sp-pie/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shotap/sp-pie/downloads","issues_url":"https://api.github.com/repos/shotap/sp-pie/issues{/number}","pulls_url":"https://api.github.com/repos/shotap/sp-pie/pulls{/number}","milestones_url":"https://api.github.com/repos/shotap/sp-pie/milestones{/number}","notifications_url":"https://api.github.com/repos/shotap/sp-pie/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shotap/sp-pie/labels{/name}","releases_url":"https://api.github.com/repos/shotap/sp-pie/releases{/id}","deployments_url":"https://api.github.com/repos/shotap/sp-pie/deployments","created_at":"2015-06-09T12:19:59Z","updated_at":"2016-02-02T18:10:36Z","pushed_at":"2016-02-11T14:35:43Z","git_url":"git://github.com/shotap/sp-pie.git","ssh_url":"git@github.com:shotap/sp-pie.git","clone_url":"https://github.com/shotap/sp-pie.git","svn_url":"https://github.com/shotap/sp-pie","homepage":null,"size":157,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/shotap/sp-pie/pulls/2"},"html":{"href":"https://github.com/shotap/sp-pie/pull/2"},"issue":{"href":"https://api.github.com/repos/shotap/sp-pie/issues/2"},"comments":{"href":"https://api.github.com/repos/shotap/sp-pie/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/shotap/sp-pie/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/shotap/sp-pie/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shotap/sp-pie/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/shotap/sp-pie/statuses/28acd9ef385df3366cfbe5280bdb2849802afd5b"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"shotap","id":4605350,"avatar_url":"https://avatars.githubusercontent.com/u/4605350?v=3","gravatar_id":"","url":"https://api.github.com/users/shotap","html_url":"https://github.com/shotap","followers_url":"https://api.github.com/users/shotap/followers","following_url":"https://api.github.com/users/shotap/following{/other_user}","gists_url":"https://api.github.com/users/shotap/gists{/gist_id}","starred_url":"https://api.github.com/users/shotap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shotap/subscriptions","organizations_url":"https://api.github.com/users/shotap/orgs","repos_url":"https://api.github.com/users/shotap/repos","events_url":"https://api.github.com/users/shotap/events{/privacy}","received_events_url":"https://api.github.com/users/shotap/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":1,"additions":5,"deletions":4,"changed_files":1}}