{"action":"created","comment":{"url":"https://api.github.com/repos/angular/material2/pulls/comments/59105876","id":59105876,"diff_hunk":"@@ -0,0 +1,255 @@\n+import {Injectable, Renderer} from 'angular2/core';\n+import {Http, Response, HTTP_PROVIDERS} from 'angular2/http';\n+import {AsyncSubject, Observer, Observable} from 'rxjs/Rx';\n+\n+/**\n+  *  Configuration for an icon, possibly including the cached SVG element.\n+  */\n+class IconConfig {\n+  svgElement: SVGElement = null;\n+  constructor(public url: string, public viewBoxSize: number) {\n+  }\n+}\n+\n+@Injectable()\n+export class MdIconProvider {\n+  // IconConfig objects and cached SVG elements for individual icons.\n+  // First level of cache is icon set (which is the empty string for the default set).\n+  // Second level is the icon name within the set.\n+  private _iconConfigs = new Map<string, Map<string, IconConfig>>();\n+\n+  // IconConfig objects and cached SVG elements for icon sets.\n+  // These are stored only by set name, but multiple URLs can be registered under the same name.\n+  private _iconSetConfigs = new Map<string, [IconConfig]>();\n+\n+  // Cache for icons loaded by direct URLs.\n+  private _cachedIconsByUrl = new Map<string, SVGElement>();\n+\n+  private _fontClassNamesByAlias = new Map<string, string>();\n+\n+  private _inProgressUrlFetches = new Map<string, Observable<string>>();\n+  \n+  private _defaultViewBoxSize = 24;\n+  private _defaultFontSetClass = 'material-icons';\n+  \n+  constructor(private _http: Http) {\n+  }\n+  \n+  public addIcon(iconName: string, url: string, viewBoxSize:number=0): MdIconProvider {\n+    return this.addIconInSet('', iconName, url, viewBoxSize);\n+  }\n+  \n+  public addIconInSet(","path":"src/components/icon/icon-provider.ts","position":42,"original_position":42,"commit_id":"82bd25ef3e5b20671325673668cb526cbe86584b","original_commit_id":"82bd25ef3e5b20671325673668cb526cbe86584b","user":{"login":"jelbourn","id":838736,"avatar_url":"https://avatars.githubusercontent.com/u/838736?v=3","gravatar_id":"","url":"https://api.github.com/users/jelbourn","html_url":"https://github.com/jelbourn","followers_url":"https://api.github.com/users/jelbourn/followers","following_url":"https://api.github.com/users/jelbourn/following{/other_user}","gists_url":"https://api.github.com/users/jelbourn/gists{/gist_id}","starred_url":"https://api.github.com/users/jelbourn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jelbourn/subscriptions","organizations_url":"https://api.github.com/users/jelbourn/orgs","repos_url":"https://api.github.com/users/jelbourn/repos","events_url":"https://api.github.com/users/jelbourn/events{/privacy}","received_events_url":"https://api.github.com/users/jelbourn/received_events","type":"User","site_admin":false},"body":"I think we can separate the concept of icon namespaces and icon sets. We can treat an icon-set is a bundle of icons all in one file, which can be added to any namespace. Perhaps it makes sense to just use the term \"icon bundle\".\r\n\r\n```ts\r\naddIcon(name, url, opt_namespace)\r\n\r\naddIconBundle(url, opt_namespace)\r\n```\r\n\r\nThen again, maybe it does make more sense to _always_ treat a \"bundle\" as a namespace. Let me run this idea by the rest of the team. ","created_at":"2016-04-09T00:33:01Z","updated_at":"2016-04-09T00:33:01Z","html_url":"https://github.com/angular/material2/pull/281#discussion_r59105876","pull_request_url":"https://api.github.com/repos/angular/material2/pulls/281","_links":{"self":{"href":"https://api.github.com/repos/angular/material2/pulls/comments/59105876"},"html":{"href":"https://github.com/angular/material2/pull/281#discussion_r59105876"},"pull_request":{"href":"https://api.github.com/repos/angular/material2/pulls/281"}}},"pull_request":{"url":"https://api.github.com/repos/angular/material2/pulls/281","id":65832490,"html_url":"https://github.com/angular/material2/pull/281","diff_url":"https://github.com/angular/material2/pull/281.diff","patch_url":"https://github.com/angular/material2/pull/281.patch","issue_url":"https://api.github.com/repos/angular/material2/issues/281","number":281,"state":"open","locked":false,"title":"md-icon (in-progress)","user":{"login":"dozingcat","id":489398,"avatar_url":"https://avatars.githubusercontent.com/u/489398?v=3","gravatar_id":"","url":"https://api.github.com/users/dozingcat","html_url":"https://github.com/dozingcat","followers_url":"https://api.github.com/users/dozingcat/followers","following_url":"https://api.github.com/users/dozingcat/following{/other_user}","gists_url":"https://api.github.com/users/dozingcat/gists{/gist_id}","starred_url":"https://api.github.com/users/dozingcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dozingcat/subscriptions","organizations_url":"https://api.github.com/users/dozingcat/orgs","repos_url":"https://api.github.com/users/dozingcat/repos","events_url":"https://api.github.com/users/dozingcat/events{/privacy}","received_events_url":"https://api.github.com/users/dozingcat/received_events","type":"User","site_admin":false},"body":"Preview PR for md-icon. Doc at https://docs.google.com/a/google.com/document/d/1zWTjnSLFPV4II9IxpIehyeSFtnzw_efdy7kEerMRIuo/edit?usp=sharing","created_at":"2016-04-08T19:04:13Z","updated_at":"2016-04-09T00:33:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d69a08ee9c42907553d14f7211b6110fd2f4f785","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/angular/material2/pulls/281/commits","review_comments_url":"https://api.github.com/repos/angular/material2/pulls/281/comments","review_comment_url":"https://api.github.com/repos/angular/material2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/material2/issues/281/comments","statuses_url":"https://api.github.com/repos/angular/material2/statuses/82bd25ef3e5b20671325673668cb526cbe86584b","head":{"label":"dozingcat:mdicon","ref":"mdicon","sha":"82bd25ef3e5b20671325673668cb526cbe86584b","user":{"login":"dozingcat","id":489398,"avatar_url":"https://avatars.githubusercontent.com/u/489398?v=3","gravatar_id":"","url":"https://api.github.com/users/dozingcat","html_url":"https://github.com/dozingcat","followers_url":"https://api.github.com/users/dozingcat/followers","following_url":"https://api.github.com/users/dozingcat/following{/other_user}","gists_url":"https://api.github.com/users/dozingcat/gists{/gist_id}","starred_url":"https://api.github.com/users/dozingcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dozingcat/subscriptions","organizations_url":"https://api.github.com/users/dozingcat/orgs","repos_url":"https://api.github.com/users/dozingcat/repos","events_url":"https://api.github.com/users/dozingcat/events{/privacy}","received_events_url":"https://api.github.com/users/dozingcat/received_events","type":"User","site_admin":false},"repo":{"id":53767913,"name":"material2","full_name":"dozingcat/material2","owner":{"login":"dozingcat","id":489398,"avatar_url":"https://avatars.githubusercontent.com/u/489398?v=3","gravatar_id":"","url":"https://api.github.com/users/dozingcat","html_url":"https://github.com/dozingcat","followers_url":"https://api.github.com/users/dozingcat/followers","following_url":"https://api.github.com/users/dozingcat/following{/other_user}","gists_url":"https://api.github.com/users/dozingcat/gists{/gist_id}","starred_url":"https://api.github.com/users/dozingcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dozingcat/subscriptions","organizations_url":"https://api.github.com/users/dozingcat/orgs","repos_url":"https://api.github.com/users/dozingcat/repos","events_url":"https://api.github.com/users/dozingcat/events{/privacy}","received_events_url":"https://api.github.com/users/dozingcat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dozingcat/material2","description":"Material Design components for Angular 2","fork":true,"url":"https://api.github.com/repos/dozingcat/material2","forks_url":"https://api.github.com/repos/dozingcat/material2/forks","keys_url":"https://api.github.com/repos/dozingcat/material2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dozingcat/material2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dozingcat/material2/teams","hooks_url":"https://api.github.com/repos/dozingcat/material2/hooks","issue_events_url":"https://api.github.com/repos/dozingcat/material2/issues/events{/number}","events_url":"https://api.github.com/repos/dozingcat/material2/events","assignees_url":"https://api.github.com/repos/dozingcat/material2/assignees{/user}","branches_url":"https://api.github.com/repos/dozingcat/material2/branches{/branch}","tags_url":"https://api.github.com/repos/dozingcat/material2/tags","blobs_url":"https://api.github.com/repos/dozingcat/material2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dozingcat/material2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dozingcat/material2/git/refs{/sha}","trees_url":"https://api.github.com/repos/dozingcat/material2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dozingcat/material2/statuses/{sha}","languages_url":"https://api.github.com/repos/dozingcat/material2/languages","stargazers_url":"https://api.github.com/repos/dozingcat/material2/stargazers","contributors_url":"https://api.github.com/repos/dozingcat/material2/contributors","subscribers_url":"https://api.github.com/repos/dozingcat/material2/subscribers","subscription_url":"https://api.github.com/repos/dozingcat/material2/subscription","commits_url":"https://api.github.com/repos/dozingcat/material2/commits{/sha}","git_commits_url":"https://api.github.com/repos/dozingcat/material2/git/commits{/sha}","comments_url":"https://api.github.com/repos/dozingcat/material2/comments{/number}","issue_comment_url":"https://api.github.com/repos/dozingcat/material2/issues/comments{/number}","contents_url":"https://api.github.com/repos/dozingcat/material2/contents/{+path}","compare_url":"https://api.github.com/repos/dozingcat/material2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dozingcat/material2/merges","archive_url":"https://api.github.com/repos/dozingcat/material2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dozingcat/material2/downloads","issues_url":"https://api.github.com/repos/dozingcat/material2/issues{/number}","pulls_url":"https://api.github.com/repos/dozingcat/material2/pulls{/number}","milestones_url":"https://api.github.com/repos/dozingcat/material2/milestones{/number}","notifications_url":"https://api.github.com/repos/dozingcat/material2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dozingcat/material2/labels{/name}","releases_url":"https://api.github.com/repos/dozingcat/material2/releases{/id}","deployments_url":"https://api.github.com/repos/dozingcat/material2/deployments","created_at":"2016-03-13T04:44:56Z","updated_at":"2016-03-13T04:44:57Z","pushed_at":"2016-04-08T19:00:26Z","git_url":"git://github.com/dozingcat/material2.git","ssh_url":"git@github.com:dozingcat/material2.git","clone_url":"https://github.com/dozingcat/material2.git","svn_url":"https://github.com/dozingcat/material2","homepage":"","size":562,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","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":"angular:master","ref":"master","sha":"f2cab2e2e3fd4ba73999fdfa012020d6e5a882e3","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":49016322,"name":"material2","full_name":"angular/material2","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/material2","description":"Material Design components for Angular 2","fork":false,"url":"https://api.github.com/repos/angular/material2","forks_url":"https://api.github.com/repos/angular/material2/forks","keys_url":"https://api.github.com/repos/angular/material2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/material2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/material2/teams","hooks_url":"https://api.github.com/repos/angular/material2/hooks","issue_events_url":"https://api.github.com/repos/angular/material2/issues/events{/number}","events_url":"https://api.github.com/repos/angular/material2/events","assignees_url":"https://api.github.com/repos/angular/material2/assignees{/user}","branches_url":"https://api.github.com/repos/angular/material2/branches{/branch}","tags_url":"https://api.github.com/repos/angular/material2/tags","blobs_url":"https://api.github.com/repos/angular/material2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/material2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/material2/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/material2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/material2/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/material2/languages","stargazers_url":"https://api.github.com/repos/angular/material2/stargazers","contributors_url":"https://api.github.com/repos/angular/material2/contributors","subscribers_url":"https://api.github.com/repos/angular/material2/subscribers","subscription_url":"https://api.github.com/repos/angular/material2/subscription","commits_url":"https://api.github.com/repos/angular/material2/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/material2/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/material2/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/material2/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/material2/contents/{+path}","compare_url":"https://api.github.com/repos/angular/material2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/material2/merges","archive_url":"https://api.github.com/repos/angular/material2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/material2/downloads","issues_url":"https://api.github.com/repos/angular/material2/issues{/number}","pulls_url":"https://api.github.com/repos/angular/material2/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/material2/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/material2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/material2/labels{/name}","releases_url":"https://api.github.com/repos/angular/material2/releases{/id}","deployments_url":"https://api.github.com/repos/angular/material2/deployments","created_at":"2016-01-04T18:50:02Z","updated_at":"2016-04-08T23:50:04Z","pushed_at":"2016-04-08T23:42:45Z","git_url":"git://github.com/angular/material2.git","ssh_url":"git@github.com:angular/material2.git","clone_url":"https://github.com/angular/material2.git","svn_url":"https://github.com/angular/material2","homepage":"","size":738,"stargazers_count":1500,"watchers_count":1500,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":176,"mirror_url":null,"open_issues_count":50,"forks":176,"open_issues":50,"watchers":1500,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/material2/pulls/281"},"html":{"href":"https://github.com/angular/material2/pull/281"},"issue":{"href":"https://api.github.com/repos/angular/material2/issues/281"},"comments":{"href":"https://api.github.com/repos/angular/material2/issues/281/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/material2/pulls/281/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/material2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/material2/pulls/281/commits"},"statuses":{"href":"https://api.github.com/repos/angular/material2/statuses/82bd25ef3e5b20671325673668cb526cbe86584b"}}}}