{"action":"created","comment":{"url":"https://api.github.com/repos/firebase/angularfire/pulls/comments/94945372","pull_request_review_id":15488287,"id":94945372,"diff_hunk":"@@ -0,0 +1,28 @@\n+(function () {\n+  \"use strict\";\n+\n+  function FirebaseStorageDirective($firebaseStorage, firebase) {\n+    return {\n+      restrict: 'A',\n+      priority: 99, // run after the attributes are interpolated\n+      scope: {},\n+      link: function (scope, element, attrs) {\n+        // $observe is like $watch but it waits for interpolation \n+        // Ex: <img firebase-src=\"{{ myUrl }}\"/> \n+        attrs.$observe('firebaseSrc', function (newVal) {\n+          if (newVal !== '' && newVal !== null && newVal !== undefined) {","path":"src/storage/FirebaseStorageDirective.js","position":13,"original_position":13,"commit_id":"8621d25a2082fdec72bc767f063f0a562e4d3d35","original_commit_id":"8621d25a2082fdec72bc767f063f0a562e4d3d35","user":{"login":"davideast","id":4570265,"avatar_url":"https://avatars.githubusercontent.com/u/4570265?v=3","gravatar_id":"","url":"https://api.github.com/users/davideast","html_url":"https://github.com/davideast","followers_url":"https://api.github.com/users/davideast/followers","following_url":"https://api.github.com/users/davideast/following{/other_user}","gists_url":"https://api.github.com/users/davideast/gists{/gist_id}","starred_url":"https://api.github.com/users/davideast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davideast/subscriptions","organizations_url":"https://api.github.com/users/davideast/orgs","repos_url":"https://api.github.com/users/davideast/repos","events_url":"https://api.github.com/users/davideast/events{/privacy}","received_events_url":"https://api.github.com/users/davideast/received_events","type":"User","site_admin":false},"body":"`newVal` is triggered once interpolation is done. I believe once interpolation is done they are equal, I went with `attrs.firebaseSrc` for assignment because it read more clearly. But I can make the variable name of `newVal` more explicit.","created_at":"2017-01-06T13:31:15Z","updated_at":"2017-01-06T13:31:15Z","html_url":"https://github.com/firebase/angularfire/pull/865#discussion_r94945372","pull_request_url":"https://api.github.com/repos/firebase/angularfire/pulls/865","_links":{"self":{"href":"https://api.github.com/repos/firebase/angularfire/pulls/comments/94945372"},"html":{"href":"https://github.com/firebase/angularfire/pull/865#discussion_r94945372"},"pull_request":{"href":"https://api.github.com/repos/firebase/angularfire/pulls/865"}}},"pull_request":{"url":"https://api.github.com/repos/firebase/angularfire/pulls/865","id":89858132,"html_url":"https://github.com/firebase/angularfire/pull/865","diff_url":"https://github.com/firebase/angularfire/pull/865.diff","patch_url":"https://github.com/firebase/angularfire/pull/865.patch","issue_url":"https://api.github.com/repos/firebase/angularfire/issues/865","number":865,"state":"open","locked":false,"title":"WIP: feat(storage): Firebase Storage for AngularFire","user":{"login":"davideast","id":4570265,"avatar_url":"https://avatars.githubusercontent.com/u/4570265?v=3","gravatar_id":"","url":"https://api.github.com/users/davideast","html_url":"https://github.com/davideast","followers_url":"https://api.github.com/users/davideast/followers","following_url":"https://api.github.com/users/davideast/following{/other_user}","gists_url":"https://api.github.com/users/davideast/gists{/gist_id}","starred_url":"https://api.github.com/users/davideast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davideast/subscriptions","organizations_url":"https://api.github.com/users/davideast/orgs","repos_url":"https://api.github.com/users/davideast/repos","events_url":"https://api.github.com/users/davideast/events{/privacy}","received_events_url":"https://api.github.com/users/davideast/received_events","type":"User","site_admin":false},"body":"## Firebase Storage for AngularFire!\r\n\r\nAddresses #785. This is a WIP PR, do not merge yet.\r\n### Description\r\n\r\nThis PR adds two new services to AngularFire, `$firebaseStorage` and the `[firebase-src]` directive.\r\n### API Reference\r\n\r\n``` ts\r\ninterface $firebaseStorage {\r\n  (ref: firebase.storage.Reference): FirebaseStorage;\r\n}\r\n\r\ninterface FirebaseStorage {\r\n  constructor (storageRef: firebase.storage.Reference);\r\n  $put(File): UploadTask;\r\n  $getDownloadURL(): Promise<string>;\r\n  $getMetadata(): Promise<Object>;\r\n  $updateMetadata(): Promise<Object>;\r\n  $delete(): Promise<void>;\r\n}\r\n\r\ninterface UploadTask {\r\n  $progress: (Object) => (); \r\n  $error: (Error) => (); \r\n  $complete: (Object) => (); \r\n  $cancel(): boolean;\r\n  $resume(): boolean;\r\n  $pause(): boolean;\r\n  then: Promise<Object>;\r\n  catch: Promise<Error>;\r\n}\r\n```\r\n### Code sample\r\n\r\n``` ts\r\nfunction MyCtrl($scope, $firebaseStorage) {\r\n  const storageRef = firebase.storage().ref('thing');\r\n  const $storage = $firebaseStorage(storageRef);\r\n  const $task = $storage.$put(someFile);\r\n  $task.$progress(snapshot => {\r\n\r\n  });\r\n  $task.$complete(snapshot => {\r\n  \r\n  });\r\n}\r\n```\r\n\r\n```html\r\n<div class=\"image-holder\">\r\n   <!-- firebase-src automatically downloads from Firebase Storage -->\r\n   <img firebase-src=\"thing\" />\r\n</div>\r\n```\r\n","created_at":"2016-10-18T17:04:11Z","updated_at":"2017-01-06T13:31:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1daa5792fad0c448180520835da3f170e6c0f525","assignee":{"login":"katowulf","id":959972,"avatar_url":"https://avatars.githubusercontent.com/u/959972?v=3","gravatar_id":"","url":"https://api.github.com/users/katowulf","html_url":"https://github.com/katowulf","followers_url":"https://api.github.com/users/katowulf/followers","following_url":"https://api.github.com/users/katowulf/following{/other_user}","gists_url":"https://api.github.com/users/katowulf/gists{/gist_id}","starred_url":"https://api.github.com/users/katowulf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katowulf/subscriptions","organizations_url":"https://api.github.com/users/katowulf/orgs","repos_url":"https://api.github.com/users/katowulf/repos","events_url":"https://api.github.com/users/katowulf/events{/privacy}","received_events_url":"https://api.github.com/users/katowulf/received_events","type":"User","site_admin":false},"assignees":[{"login":"katowulf","id":959972,"avatar_url":"https://avatars.githubusercontent.com/u/959972?v=3","gravatar_id":"","url":"https://api.github.com/users/katowulf","html_url":"https://github.com/katowulf","followers_url":"https://api.github.com/users/katowulf/followers","following_url":"https://api.github.com/users/katowulf/following{/other_user}","gists_url":"https://api.github.com/users/katowulf/gists{/gist_id}","starred_url":"https://api.github.com/users/katowulf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katowulf/subscriptions","organizations_url":"https://api.github.com/users/katowulf/orgs","repos_url":"https://api.github.com/users/katowulf/repos","events_url":"https://api.github.com/users/katowulf/events{/privacy}","received_events_url":"https://api.github.com/users/katowulf/received_events","type":"User","site_admin":false},{"login":"davideast","id":4570265,"avatar_url":"https://avatars.githubusercontent.com/u/4570265?v=3","gravatar_id":"","url":"https://api.github.com/users/davideast","html_url":"https://github.com/davideast","followers_url":"https://api.github.com/users/davideast/followers","following_url":"https://api.github.com/users/davideast/following{/other_user}","gists_url":"https://api.github.com/users/davideast/gists{/gist_id}","starred_url":"https://api.github.com/users/davideast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davideast/subscriptions","organizations_url":"https://api.github.com/users/davideast/orgs","repos_url":"https://api.github.com/users/davideast/repos","events_url":"https://api.github.com/users/davideast/events{/privacy}","received_events_url":"https://api.github.com/users/davideast/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/firebase/angularfire/milestones/9","html_url":"https://github.com/firebase/angularfire/milestone/9","labels_url":"https://api.github.com/repos/firebase/angularfire/milestones/9/labels","id":1871239,"number":9,"title":"AngularFire 3.0.0","description":"Firebase Storage","creator":{"login":"davideast","id":4570265,"avatar_url":"https://avatars.githubusercontent.com/u/4570265?v=3","gravatar_id":"","url":"https://api.github.com/users/davideast","html_url":"https://github.com/davideast","followers_url":"https://api.github.com/users/davideast/followers","following_url":"https://api.github.com/users/davideast/following{/other_user}","gists_url":"https://api.github.com/users/davideast/gists{/gist_id}","starred_url":"https://api.github.com/users/davideast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davideast/subscriptions","organizations_url":"https://api.github.com/users/davideast/orgs","repos_url":"https://api.github.com/users/davideast/repos","events_url":"https://api.github.com/users/davideast/events{/privacy}","received_events_url":"https://api.github.com/users/davideast/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2016-07-07T22:51:01Z","updated_at":"2016-10-18T17:52:41Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/firebase/angularfire/pulls/865/commits","review_comments_url":"https://api.github.com/repos/firebase/angularfire/pulls/865/comments","review_comment_url":"https://api.github.com/repos/firebase/angularfire/pulls/comments{/number}","comments_url":"https://api.github.com/repos/firebase/angularfire/issues/865/comments","statuses_url":"https://api.github.com/repos/firebase/angularfire/statuses/8621d25a2082fdec72bc767f063f0a562e4d3d35","head":{"label":"firebase:storage","ref":"storage","sha":"8621d25a2082fdec72bc767f063f0a562e4d3d35","user":{"login":"firebase","id":1335026,"avatar_url":"https://avatars.githubusercontent.com/u/1335026?v=3","gravatar_id":"","url":"https://api.github.com/users/firebase","html_url":"https://github.com/firebase","followers_url":"https://api.github.com/users/firebase/followers","following_url":"https://api.github.com/users/firebase/following{/other_user}","gists_url":"https://api.github.com/users/firebase/gists{/gist_id}","starred_url":"https://api.github.com/users/firebase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firebase/subscriptions","organizations_url":"https://api.github.com/users/firebase/orgs","repos_url":"https://api.github.com/users/firebase/repos","events_url":"https://api.github.com/users/firebase/events{/privacy}","received_events_url":"https://api.github.com/users/firebase/received_events","type":"Organization","site_admin":false},"repo":{"id":8962069,"name":"angularfire","full_name":"firebase/angularfire","owner":{"login":"firebase","id":1335026,"avatar_url":"https://avatars.githubusercontent.com/u/1335026?v=3","gravatar_id":"","url":"https://api.github.com/users/firebase","html_url":"https://github.com/firebase","followers_url":"https://api.github.com/users/firebase/followers","following_url":"https://api.github.com/users/firebase/following{/other_user}","gists_url":"https://api.github.com/users/firebase/gists{/gist_id}","starred_url":"https://api.github.com/users/firebase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firebase/subscriptions","organizations_url":"https://api.github.com/users/firebase/orgs","repos_url":"https://api.github.com/users/firebase/repos","events_url":"https://api.github.com/users/firebase/events{/privacy}","received_events_url":"https://api.github.com/users/firebase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/firebase/angularfire","description":"AngularJS bindings for Firebase","fork":false,"url":"https://api.github.com/repos/firebase/angularfire","forks_url":"https://api.github.com/repos/firebase/angularfire/forks","keys_url":"https://api.github.com/repos/firebase/angularfire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/firebase/angularfire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/firebase/angularfire/teams","hooks_url":"https://api.github.com/repos/firebase/angularfire/hooks","issue_events_url":"https://api.github.com/repos/firebase/angularfire/issues/events{/number}","events_url":"https://api.github.com/repos/firebase/angularfire/events","assignees_url":"https://api.github.com/repos/firebase/angularfire/assignees{/user}","branches_url":"https://api.github.com/repos/firebase/angularfire/branches{/branch}","tags_url":"https://api.github.com/repos/firebase/angularfire/tags","blobs_url":"https://api.github.com/repos/firebase/angularfire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/firebase/angularfire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/firebase/angularfire/git/refs{/sha}","trees_url":"https://api.github.com/repos/firebase/angularfire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/firebase/angularfire/statuses/{sha}","languages_url":"https://api.github.com/repos/firebase/angularfire/languages","stargazers_url":"https://api.github.com/repos/firebase/angularfire/stargazers","contributors_url":"https://api.github.com/repos/firebase/angularfire/contributors","subscribers_url":"https://api.github.com/repos/firebase/angularfire/subscribers","subscription_url":"https://api.github.com/repos/firebase/angularfire/subscription","commits_url":"https://api.github.com/repos/firebase/angularfire/commits{/sha}","git_commits_url":"https://api.github.com/repos/firebase/angularfire/git/commits{/sha}","comments_url":"https://api.github.com/repos/firebase/angularfire/comments{/number}","issue_comment_url":"https://api.github.com/repos/firebase/angularfire/issues/comments{/number}","contents_url":"https://api.github.com/repos/firebase/angularfire/contents/{+path}","compare_url":"https://api.github.com/repos/firebase/angularfire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/firebase/angularfire/merges","archive_url":"https://api.github.com/repos/firebase/angularfire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/firebase/angularfire/downloads","issues_url":"https://api.github.com/repos/firebase/angularfire/issues{/number}","pulls_url":"https://api.github.com/repos/firebase/angularfire/pulls{/number}","milestones_url":"https://api.github.com/repos/firebase/angularfire/milestones{/number}","notifications_url":"https://api.github.com/repos/firebase/angularfire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/firebase/angularfire/labels{/name}","releases_url":"https://api.github.com/repos/firebase/angularfire/releases{/id}","deployments_url":"https://api.github.com/repos/firebase/angularfire/deployments","created_at":"2013-03-22T22:18:38Z","updated_at":"2017-01-06T13:22:59Z","pushed_at":"2017-01-03T17:29:14Z","git_url":"git://github.com/firebase/angularfire.git","ssh_url":"git@github.com:firebase/angularfire.git","clone_url":"https://github.com/firebase/angularfire.git","svn_url":"https://github.com/firebase/angularfire","homepage":"","size":1902,"stargazers_count":2320,"watchers_count":2320,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":560,"mirror_url":null,"open_issues_count":13,"forks":560,"open_issues":13,"watchers":2320,"default_branch":"master"}},"base":{"label":"firebase:master","ref":"master","sha":"c22ef72f34e9ef390e33ba51975698fabd9907ad","user":{"login":"firebase","id":1335026,"avatar_url":"https://avatars.githubusercontent.com/u/1335026?v=3","gravatar_id":"","url":"https://api.github.com/users/firebase","html_url":"https://github.com/firebase","followers_url":"https://api.github.com/users/firebase/followers","following_url":"https://api.github.com/users/firebase/following{/other_user}","gists_url":"https://api.github.com/users/firebase/gists{/gist_id}","starred_url":"https://api.github.com/users/firebase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firebase/subscriptions","organizations_url":"https://api.github.com/users/firebase/orgs","repos_url":"https://api.github.com/users/firebase/repos","events_url":"https://api.github.com/users/firebase/events{/privacy}","received_events_url":"https://api.github.com/users/firebase/received_events","type":"Organization","site_admin":false},"repo":{"id":8962069,"name":"angularfire","full_name":"firebase/angularfire","owner":{"login":"firebase","id":1335026,"avatar_url":"https://avatars.githubusercontent.com/u/1335026?v=3","gravatar_id":"","url":"https://api.github.com/users/firebase","html_url":"https://github.com/firebase","followers_url":"https://api.github.com/users/firebase/followers","following_url":"https://api.github.com/users/firebase/following{/other_user}","gists_url":"https://api.github.com/users/firebase/gists{/gist_id}","starred_url":"https://api.github.com/users/firebase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firebase/subscriptions","organizations_url":"https://api.github.com/users/firebase/orgs","repos_url":"https://api.github.com/users/firebase/repos","events_url":"https://api.github.com/users/firebase/events{/privacy}","received_events_url":"https://api.github.com/users/firebase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/firebase/angularfire","description":"AngularJS bindings for Firebase","fork":false,"url":"https://api.github.com/repos/firebase/angularfire","forks_url":"https://api.github.com/repos/firebase/angularfire/forks","keys_url":"https://api.github.com/repos/firebase/angularfire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/firebase/angularfire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/firebase/angularfire/teams","hooks_url":"https://api.github.com/repos/firebase/angularfire/hooks","issue_events_url":"https://api.github.com/repos/firebase/angularfire/issues/events{/number}","events_url":"https://api.github.com/repos/firebase/angularfire/events","assignees_url":"https://api.github.com/repos/firebase/angularfire/assignees{/user}","branches_url":"https://api.github.com/repos/firebase/angularfire/branches{/branch}","tags_url":"https://api.github.com/repos/firebase/angularfire/tags","blobs_url":"https://api.github.com/repos/firebase/angularfire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/firebase/angularfire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/firebase/angularfire/git/refs{/sha}","trees_url":"https://api.github.com/repos/firebase/angularfire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/firebase/angularfire/statuses/{sha}","languages_url":"https://api.github.com/repos/firebase/angularfire/languages","stargazers_url":"https://api.github.com/repos/firebase/angularfire/stargazers","contributors_url":"https://api.github.com/repos/firebase/angularfire/contributors","subscribers_url":"https://api.github.com/repos/firebase/angularfire/subscribers","subscription_url":"https://api.github.com/repos/firebase/angularfire/subscription","commits_url":"https://api.github.com/repos/firebase/angularfire/commits{/sha}","git_commits_url":"https://api.github.com/repos/firebase/angularfire/git/commits{/sha}","comments_url":"https://api.github.com/repos/firebase/angularfire/comments{/number}","issue_comment_url":"https://api.github.com/repos/firebase/angularfire/issues/comments{/number}","contents_url":"https://api.github.com/repos/firebase/angularfire/contents/{+path}","compare_url":"https://api.github.com/repos/firebase/angularfire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/firebase/angularfire/merges","archive_url":"https://api.github.com/repos/firebase/angularfire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/firebase/angularfire/downloads","issues_url":"https://api.github.com/repos/firebase/angularfire/issues{/number}","pulls_url":"https://api.github.com/repos/firebase/angularfire/pulls{/number}","milestones_url":"https://api.github.com/repos/firebase/angularfire/milestones{/number}","notifications_url":"https://api.github.com/repos/firebase/angularfire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/firebase/angularfire/labels{/name}","releases_url":"https://api.github.com/repos/firebase/angularfire/releases{/id}","deployments_url":"https://api.github.com/repos/firebase/angularfire/deployments","created_at":"2013-03-22T22:18:38Z","updated_at":"2017-01-06T13:22:59Z","pushed_at":"2017-01-03T17:29:14Z","git_url":"git://github.com/firebase/angularfire.git","ssh_url":"git@github.com:firebase/angularfire.git","clone_url":"https://github.com/firebase/angularfire.git","svn_url":"https://github.com/firebase/angularfire","homepage":"","size":1902,"stargazers_count":2320,"watchers_count":2320,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":560,"mirror_url":null,"open_issues_count":13,"forks":560,"open_issues":13,"watchers":2320,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/firebase/angularfire/pulls/865"},"html":{"href":"https://github.com/firebase/angularfire/pull/865"},"issue":{"href":"https://api.github.com/repos/firebase/angularfire/issues/865"},"comments":{"href":"https://api.github.com/repos/firebase/angularfire/issues/865/comments"},"review_comments":{"href":"https://api.github.com/repos/firebase/angularfire/pulls/865/comments"},"review_comment":{"href":"https://api.github.com/repos/firebase/angularfire/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/firebase/angularfire/pulls/865/commits"},"statuses":{"href":"https://api.github.com/repos/firebase/angularfire/statuses/8621d25a2082fdec72bc767f063f0a562e4d3d35"}}}}
{"actor":{"display_login":"davideast"}}