{"action":"opened","number":742,"pull_request":{"url":"https://api.github.com/repos/apache/incubator-zeppelin/pulls/742","id":60354924,"html_url":"https://github.com/apache/incubator-zeppelin/pull/742","diff_url":"https://github.com/apache/incubator-zeppelin/pull/742.diff","patch_url":"https://github.com/apache/incubator-zeppelin/pull/742.patch","issue_url":"https://api.github.com/repos/apache/incubator-zeppelin/issues/742","number":742,"state":"open","locked":false,"title":"[ZEPPELIN-695] Add AngularJS z.runParagraph()","user":{"login":"doanduyhai","id":1532977,"avatar_url":"https://avatars.githubusercontent.com/u/1532977?v=3","gravatar_id":"","url":"https://api.github.com/users/doanduyhai","html_url":"https://github.com/doanduyhai","followers_url":"https://api.github.com/users/doanduyhai/followers","following_url":"https://api.github.com/users/doanduyhai/following{/other_user}","gists_url":"https://api.github.com/users/doanduyhai/gists{/gist_id}","starred_url":"https://api.github.com/users/doanduyhai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doanduyhai/subscriptions","organizations_url":"https://api.github.com/users/doanduyhai/orgs","repos_url":"https://api.github.com/users/doanduyhai/repos","events_url":"https://api.github.com/users/doanduyhai/events{/privacy}","received_events_url":"https://api.github.com/users/doanduyhai/received_events","type":"User","site_admin":false},"body":"### What is this PR for?\r\nAdd AngularJS `z.runParagraph()` and `z.runParagraphs()` methods\r\n\r\n@corneadoug \r\nOn the client-side, inside the scope of a paragraph, we cannot access to the list of all existing paragraphs for the current note. In my previous implementation, I was using the following trick:\r\n\r\n```\r\nvar paragraphDiv = angular.element('#' + paragraphId +\r\n                                '_paragraphColumn_main[ng-controller=\"ParagraphCtrl\"]');\r\n\r\nvar paragraph = paragraphDiv.scope().paragraph;\r\n```\r\n\r\nThis is **dirty** and can be broken if we change the CSS style tomorrow for paragraph.\r\n\r\nFor the current implementation, what I did is to **inject** a reference to the `note` object into the `$scope` of paragraph so that we can access the current list of paragraph **programmatically**: \r\n\r\n```javascript\r\n        $scope.$broadcast('updateParagraph', {\r\n          note: $scope.note, // pass the note object to paragraph scope\r\n          paragraph: note.paragraphs[index]});\r\n```\r\n\r\n_This is a sub-task of epic **[ZEPPELIN-635]**_\r\n\r\n### What type of PR is it?\r\n[Improvement### Todos\r\n* [ ] - Code Review\r\n* [ ] - Simple Test\r\n\r\n### Is there a relevant Jira issue?\r\n**[ZEPPELIN-695]**\r\n\r\n### How should this be tested?\r\n* Create a new note\r\n* In the first paragraph, put the following code\r\n\r\n```html\r\n%angular\r\n\r\n<form class=\"form-inline\">\r\n  <div class=\"form-group\">\r\n    <label for=\"paragraphId\">Paragraph Id: </label>\r\n    <input type=\"text\" class=\"form-control\" id=\"paragraphId\" placeholder=\"Paragraph Id ...\" ng-model=\"paragraph\"></input>\r\n  </div>\r\n  <button type=\"submit\" class=\"btn btn-primary\" ng-click=\"z.runParagraph(paragraph)\"> Run Paragraph</button>\r\n</form>\r\n```\r\n* Create a second paragraph with the following code:\r\n\r\n```scala\r\nz.getInterpreterContext().getParagraphId()\r\nprintln(\"Date \"+new java.util.Date().toString)\r\n```\r\n* Execute the second paragraph to retrieve its paragraph id\r\n* In the first paragraph, put the paragraph id in the input text and click on the **Run Paragraph** button, it should trigger execution of the second paragraph\r\n\r\n### Screenshots (if appropriate)\r\n![angularrunparagraph](https://cloud.githubusercontent.com/assets/1532977/13255885/8ff5c604-da48-11e5-9e1c-3216074fbb17.gif)\r\n\r\n### Questions:\r\n* Does the licenses files need update? --> **No**\r\n* Is there breaking changes for older versions? --> **No**\r\n* Does this needs documentation? --> **Yes**\r\n\r\n[ZEPPELIN-635]: https://issues.apache.org/jira/browse/ZEPPELIN-635\r\n[ZEPPELIN-695]: https://issues.apache.org/jira/browse/ZEPPELIN-695","created_at":"2016-02-23T15:16:48Z","updated_at":"2016-02-23T15:16:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-zeppelin/pulls/742/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-zeppelin/pulls/742/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-zeppelin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-zeppelin/issues/742/comments","statuses_url":"https://api.github.com/repos/apache/incubator-zeppelin/statuses/c3a857a3d8379188c65e41edf013ebb3b826bb49","head":{"label":"doanduyhai:ZEPPELIN-695","ref":"ZEPPELIN-695","sha":"c3a857a3d8379188c65e41edf013ebb3b826bb49","user":{"login":"doanduyhai","id":1532977,"avatar_url":"https://avatars.githubusercontent.com/u/1532977?v=3","gravatar_id":"","url":"https://api.github.com/users/doanduyhai","html_url":"https://github.com/doanduyhai","followers_url":"https://api.github.com/users/doanduyhai/followers","following_url":"https://api.github.com/users/doanduyhai/following{/other_user}","gists_url":"https://api.github.com/users/doanduyhai/gists{/gist_id}","starred_url":"https://api.github.com/users/doanduyhai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doanduyhai/subscriptions","organizations_url":"https://api.github.com/users/doanduyhai/orgs","repos_url":"https://api.github.com/users/doanduyhai/repos","events_url":"https://api.github.com/users/doanduyhai/events{/privacy}","received_events_url":"https://api.github.com/users/doanduyhai/received_events","type":"User","site_admin":false},"repo":{"id":35973266,"name":"incubator-zeppelin","full_name":"doanduyhai/incubator-zeppelin","owner":{"login":"doanduyhai","id":1532977,"avatar_url":"https://avatars.githubusercontent.com/u/1532977?v=3","gravatar_id":"","url":"https://api.github.com/users/doanduyhai","html_url":"https://github.com/doanduyhai","followers_url":"https://api.github.com/users/doanduyhai/followers","following_url":"https://api.github.com/users/doanduyhai/following{/other_user}","gists_url":"https://api.github.com/users/doanduyhai/gists{/gist_id}","starred_url":"https://api.github.com/users/doanduyhai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doanduyhai/subscriptions","organizations_url":"https://api.github.com/users/doanduyhai/orgs","repos_url":"https://api.github.com/users/doanduyhai/repos","events_url":"https://api.github.com/users/doanduyhai/events{/privacy}","received_events_url":"https://api.github.com/users/doanduyhai/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/doanduyhai/incubator-zeppelin","description":"Mirror of Apache Zeppelin (Incubating)","fork":true,"url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin","forks_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/forks","keys_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/teams","hooks_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/hooks","issue_events_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/issues/events{/number}","events_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/events","assignees_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/assignees{/user}","branches_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/branches{/branch}","tags_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/tags","blobs_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/git/refs{/sha}","trees_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/statuses/{sha}","languages_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/languages","stargazers_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/stargazers","contributors_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/contributors","subscribers_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/subscribers","subscription_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/subscription","commits_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/commits{/sha}","git_commits_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/git/commits{/sha}","comments_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/comments{/number}","issue_comment_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/issues/comments{/number}","contents_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/contents/{+path}","compare_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/merges","archive_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/downloads","issues_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/issues{/number}","pulls_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/pulls{/number}","milestones_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/milestones{/number}","notifications_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/labels{/name}","releases_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/releases{/id}","deployments_url":"https://api.github.com/repos/doanduyhai/incubator-zeppelin/deployments","created_at":"2015-05-20T20:45:02Z","updated_at":"2016-01-19T10:56:26Z","pushed_at":"2016-02-23T15:07:49Z","git_url":"git://github.com/doanduyhai/incubator-zeppelin.git","ssh_url":"git@github.com:doanduyhai/incubator-zeppelin.git","clone_url":"https://github.com/doanduyhai/incubator-zeppelin.git","svn_url":"https://github.com/doanduyhai/incubator-zeppelin","homepage":null,"size":21223,"stargazers_count":8,"watchers_count":8,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":8,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"98cb8e8c116c79a880708743cfa1766885914b56","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":32848140,"name":"incubator-zeppelin","full_name":"apache/incubator-zeppelin","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/incubator-zeppelin","description":"Mirror of Apache Zeppelin (Incubating)","fork":false,"url":"https://api.github.com/repos/apache/incubator-zeppelin","forks_url":"https://api.github.com/repos/apache/incubator-zeppelin/forks","keys_url":"https://api.github.com/repos/apache/incubator-zeppelin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-zeppelin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-zeppelin/teams","hooks_url":"https://api.github.com/repos/apache/incubator-zeppelin/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-zeppelin/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-zeppelin/events","assignees_url":"https://api.github.com/repos/apache/incubator-zeppelin/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-zeppelin/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-zeppelin/tags","blobs_url":"https://api.github.com/repos/apache/incubator-zeppelin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-zeppelin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-zeppelin/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-zeppelin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-zeppelin/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-zeppelin/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-zeppelin/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-zeppelin/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-zeppelin/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-zeppelin/subscription","commits_url":"https://api.github.com/repos/apache/incubator-zeppelin/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-zeppelin/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-zeppelin/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-zeppelin/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-zeppelin/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-zeppelin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-zeppelin/merges","archive_url":"https://api.github.com/repos/apache/incubator-zeppelin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-zeppelin/downloads","issues_url":"https://api.github.com/repos/apache/incubator-zeppelin/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-zeppelin/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-zeppelin/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-zeppelin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-zeppelin/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-zeppelin/releases{/id}","deployments_url":"https://api.github.com/repos/apache/incubator-zeppelin/deployments","created_at":"2015-03-25T07:00:06Z","updated_at":"2016-02-22T22:46:36Z","pushed_at":"2016-02-23T14:30:10Z","git_url":"git://github.com/apache/incubator-zeppelin.git","ssh_url":"git@github.com:apache/incubator-zeppelin.git","clone_url":"https://github.com/apache/incubator-zeppelin.git","svn_url":"https://github.com/apache/incubator-zeppelin","homepage":null,"size":93836,"stargazers_count":1181,"watchers_count":1181,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":582,"mirror_url":"git://git.apache.org/incubator-zeppelin.git","open_issues_count":88,"forks":582,"open_issues":88,"watchers":1181,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-zeppelin/pulls/742"},"html":{"href":"https://github.com/apache/incubator-zeppelin/pull/742"},"issue":{"href":"https://api.github.com/repos/apache/incubator-zeppelin/issues/742"},"comments":{"href":"https://api.github.com/repos/apache/incubator-zeppelin/issues/742/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-zeppelin/pulls/742/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-zeppelin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-zeppelin/pulls/742/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-zeppelin/statuses/c3a857a3d8379188c65e41edf013ebb3b826bb49"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":6,"additions":1467,"deletions":123,"changed_files":23}}