{"action":"created","comment":{"url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/pulls/comments/54835185","id":54835185,"diff_hunk":"@@ -1,110 +1,32 @@\n ﻿(function (ngxBootstrap) {\n   ngxBootstrap.ngxClass.ngxLabelClass = ngxLabel;\n-  ngxBootstrap.ngxClass.ngxLabelPrimaryClass = ngxLabelPrimary;\n-  ngxBootstrap.ngxClass.ngxLabelInfoClass = ngxLabelInfo;\n-  ngxBootstrap.ngxClass.ngxLabelSuccessClass = ngxLabelSuccess;\n-  ngxBootstrap.ngxClass.ngxLabelWarningClass = ngxLabelWarning;\n-  ngxBootstrap.ngxClass.ngxLabelDangerClass = ngxLabelDanger;\n \n   ngxBootstrap.ngxComponents.ngxLabelComponent = ng.core.Directive({\n     selector: 'ngx-label',\n+    inputs: ['color']\n   })\n   .Class(new ngxLabel());\n \n-  ngxBootstrap.ngxComponents.ngxLabelPrimaryComponent = ng.core.Directive({\n-    selector: 'ngx-label-primary',\n-  })\n-  .Class(new ngxLabelPrimary());\n-\n-  ngxBootstrap.ngxComponents.ngxLabelInfoComponent = ng.core.Directive({\n-    selector: 'ngx-label-info',\n-  })\n-  .Class(new ngxLabelInfo());\n-\n-  ngxBootstrap.ngxComponents.ngxLabelSuccessComponent = ng.core.Directive({\n-    selector: 'ngx-label-success',\n-  })\n-  .Class(new ngxLabelSuccess());\n-\n-  ngxBootstrap.ngxComponents.ngxLabelWarningComponent = ng.core.Directive({\n-    selector: 'ngx-label-warning',\n-  })\n-  .Class(new ngxLabelWarning());\n-\n-  ngxBootstrap.ngxComponents.ngxLabelDangerComponent = ng.core.Directive({\n-    selector: 'ngx-label-danger',\n-  })\n-  .Class(new ngxLabelDanger());\n-\n-\n   function ngxLabel() {\n-    var _nativeElement;\n-\n-    this.constructor = [ng.core.ElementRef, function (elementRef) {\n-      this.onConstructing(elementRef);\n+    this.constructor = [ng.core.ElementRef, ngxBootstrap.ngxComponents.ngxLabelService, function (elementRef, ngxLabelService) {\n+      this.ngxLabelService = ngxLabelService;\n+      this.nativeElement = elementRef.nativeElement;\n     }];\n \n-    this.onConstructing = function (elementRef) {\n-      _nativeElement = elementRef.nativeElement;\n-    };\n-\n     this.ngAfterViewInit = function () {\n-      if (_nativeElement.className) {\n-        _nativeElement.className = this.getClassName() + ' ' + _nativeElement.className;\n+      var _className = this.getClassName() + ' ' + this.ngxLabelService.getColorClass(this.color);\n+\n+      if (this.nativeElement.className) {","path":"components/label/label.component.js","position":60,"original_position":60,"commit_id":"f504cb43f5c0e6f344f35c37d6afcbf7ce133388","original_commit_id":"f504cb43f5c0e6f344f35c37d6afcbf7ce133388","user":{"login":"thanhtranit","id":8432750,"avatar_url":"https://avatars.githubusercontent.com/u/8432750?v=3","gravatar_id":"","url":"https://api.github.com/users/thanhtranit","html_url":"https://github.com/thanhtranit","followers_url":"https://api.github.com/users/thanhtranit/followers","following_url":"https://api.github.com/users/thanhtranit/following{/other_user}","gists_url":"https://api.github.com/users/thanhtranit/gists{/gist_id}","starred_url":"https://api.github.com/users/thanhtranit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanhtranit/subscriptions","organizations_url":"https://api.github.com/users/thanhtranit/orgs","repos_url":"https://api.github.com/users/thanhtranit/repos","events_url":"https://api.github.com/users/thanhtranit/events{/privacy}","received_events_url":"https://api.github.com/users/thanhtranit/received_events","type":"User","site_admin":false},"body":"Please use Renderer.setElementClass(renderElement: any, className: string, isAdd: boolean) to add or remove class\r\nhttps://angular.io/docs/ts/latest/api/core/Renderer-class.html\r\nex: this.renderer.setElementClass(this.elementRef.nativeElement, 'color', true);","created_at":"2016-03-03T04:32:33Z","updated_at":"2016-03-03T04:32:33Z","html_url":"https://github.com/angular-esx/ngx-bootstrap/pull/9#discussion_r54835185","pull_request_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/angular-esx/ngx-bootstrap/pulls/comments/54835185"},"html":{"href":"https://github.com/angular-esx/ngx-bootstrap/pull/9#discussion_r54835185"},"pull_request":{"href":"https://api.github.com/repos/angular-esx/ngx-bootstrap/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/pulls/9","id":61274903,"html_url":"https://github.com/angular-esx/ngx-bootstrap/pull/9","diff_url":"https://github.com/angular-esx/ngx-bootstrap/pull/9.diff","patch_url":"https://github.com/angular-esx/ngx-bootstrap/pull/9.patch","issue_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/issues/9","number":9,"state":"open","locked":false,"title":"[ngxLabelComponent] Make inheritance and DI easier","user":{"login":"Minh-Van","id":16897836,"avatar_url":"https://avatars.githubusercontent.com/u/16897836?v=3","gravatar_id":"","url":"https://api.github.com/users/Minh-Van","html_url":"https://github.com/Minh-Van","followers_url":"https://api.github.com/users/Minh-Van/followers","following_url":"https://api.github.com/users/Minh-Van/following{/other_user}","gists_url":"https://api.github.com/users/Minh-Van/gists{/gist_id}","starred_url":"https://api.github.com/users/Minh-Van/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Minh-Van/subscriptions","organizations_url":"https://api.github.com/users/Minh-Van/orgs","repos_url":"https://api.github.com/users/Minh-Van/repos","events_url":"https://api.github.com/users/Minh-Van/events{/privacy}","received_events_url":"https://api.github.com/users/Minh-Van/received_events","type":"User","site_admin":false},"body":"[ngxLabelComponent] Make inheritance and DI easier","created_at":"2016-03-01T17:07:59Z","updated_at":"2016-03-03T04:32:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"daa73c35d659af3080e41514c6c9972a064260da","assignee":{"login":"thanhtranit","id":8432750,"avatar_url":"https://avatars.githubusercontent.com/u/8432750?v=3","gravatar_id":"","url":"https://api.github.com/users/thanhtranit","html_url":"https://github.com/thanhtranit","followers_url":"https://api.github.com/users/thanhtranit/followers","following_url":"https://api.github.com/users/thanhtranit/following{/other_user}","gists_url":"https://api.github.com/users/thanhtranit/gists{/gist_id}","starred_url":"https://api.github.com/users/thanhtranit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanhtranit/subscriptions","organizations_url":"https://api.github.com/users/thanhtranit/orgs","repos_url":"https://api.github.com/users/thanhtranit/repos","events_url":"https://api.github.com/users/thanhtranit/events{/privacy}","received_events_url":"https://api.github.com/users/thanhtranit/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/pulls/9/commits","review_comments_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/pulls/9/comments","review_comment_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/issues/9/comments","statuses_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/statuses/f504cb43f5c0e6f344f35c37d6afcbf7ce133388","head":{"label":"angular-esx:bugfix/ngxLabelComponent_make-inheritance-and-DI-easier","ref":"bugfix/ngxLabelComponent_make-inheritance-and-DI-easier","sha":"f504cb43f5c0e6f344f35c37d6afcbf7ce133388","user":{"login":"angular-esx","id":16442153,"avatar_url":"https://avatars.githubusercontent.com/u/16442153?v=3","gravatar_id":"","url":"https://api.github.com/users/angular-esx","html_url":"https://github.com/angular-esx","followers_url":"https://api.github.com/users/angular-esx/followers","following_url":"https://api.github.com/users/angular-esx/following{/other_user}","gists_url":"https://api.github.com/users/angular-esx/gists{/gist_id}","starred_url":"https://api.github.com/users/angular-esx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular-esx/subscriptions","organizations_url":"https://api.github.com/users/angular-esx/orgs","repos_url":"https://api.github.com/users/angular-esx/repos","events_url":"https://api.github.com/users/angular-esx/events{/privacy}","received_events_url":"https://api.github.com/users/angular-esx/received_events","type":"Organization","site_admin":false},"repo":{"id":50855434,"name":"ngx-bootstrap","full_name":"angular-esx/ngx-bootstrap","owner":{"login":"angular-esx","id":16442153,"avatar_url":"https://avatars.githubusercontent.com/u/16442153?v=3","gravatar_id":"","url":"https://api.github.com/users/angular-esx","html_url":"https://github.com/angular-esx","followers_url":"https://api.github.com/users/angular-esx/followers","following_url":"https://api.github.com/users/angular-esx/following{/other_user}","gists_url":"https://api.github.com/users/angular-esx/gists{/gist_id}","starred_url":"https://api.github.com/users/angular-esx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular-esx/subscriptions","organizations_url":"https://api.github.com/users/angular-esx/orgs","repos_url":"https://api.github.com/users/angular-esx/repos","events_url":"https://api.github.com/users/angular-esx/events{/privacy}","received_events_url":"https://api.github.com/users/angular-esx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular-esx/ngx-bootstrap","description":"","fork":false,"url":"https://api.github.com/repos/angular-esx/ngx-bootstrap","forks_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/forks","keys_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/teams","hooks_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/hooks","issue_events_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/issues/events{/number}","events_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/events","assignees_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/assignees{/user}","branches_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/branches{/branch}","tags_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/tags","blobs_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/statuses/{sha}","languages_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/languages","stargazers_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/stargazers","contributors_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/contributors","subscribers_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/subscribers","subscription_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/subscription","commits_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/contents/{+path}","compare_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/merges","archive_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/downloads","issues_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/issues{/number}","pulls_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/pulls{/number}","milestones_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/milestones{/number}","notifications_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/labels{/name}","releases_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/releases{/id}","deployments_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/deployments","created_at":"2016-02-01T17:03:45Z","updated_at":"2016-02-06T11:35:24Z","pushed_at":"2016-03-01T17:07:59Z","git_url":"git://github.com/angular-esx/ngx-bootstrap.git","ssh_url":"git@github.com:angular-esx/ngx-bootstrap.git","clone_url":"https://github.com/angular-esx/ngx-bootstrap.git","svn_url":"https://github.com/angular-esx/ngx-bootstrap","homepage":null,"size":48,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"angular-esx:develop","ref":"develop","sha":"f15c3cb37df717cac6f167c8e79ec81a3bf6c1ce","user":{"login":"angular-esx","id":16442153,"avatar_url":"https://avatars.githubusercontent.com/u/16442153?v=3","gravatar_id":"","url":"https://api.github.com/users/angular-esx","html_url":"https://github.com/angular-esx","followers_url":"https://api.github.com/users/angular-esx/followers","following_url":"https://api.github.com/users/angular-esx/following{/other_user}","gists_url":"https://api.github.com/users/angular-esx/gists{/gist_id}","starred_url":"https://api.github.com/users/angular-esx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular-esx/subscriptions","organizations_url":"https://api.github.com/users/angular-esx/orgs","repos_url":"https://api.github.com/users/angular-esx/repos","events_url":"https://api.github.com/users/angular-esx/events{/privacy}","received_events_url":"https://api.github.com/users/angular-esx/received_events","type":"Organization","site_admin":false},"repo":{"id":50855434,"name":"ngx-bootstrap","full_name":"angular-esx/ngx-bootstrap","owner":{"login":"angular-esx","id":16442153,"avatar_url":"https://avatars.githubusercontent.com/u/16442153?v=3","gravatar_id":"","url":"https://api.github.com/users/angular-esx","html_url":"https://github.com/angular-esx","followers_url":"https://api.github.com/users/angular-esx/followers","following_url":"https://api.github.com/users/angular-esx/following{/other_user}","gists_url":"https://api.github.com/users/angular-esx/gists{/gist_id}","starred_url":"https://api.github.com/users/angular-esx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular-esx/subscriptions","organizations_url":"https://api.github.com/users/angular-esx/orgs","repos_url":"https://api.github.com/users/angular-esx/repos","events_url":"https://api.github.com/users/angular-esx/events{/privacy}","received_events_url":"https://api.github.com/users/angular-esx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular-esx/ngx-bootstrap","description":"","fork":false,"url":"https://api.github.com/repos/angular-esx/ngx-bootstrap","forks_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/forks","keys_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/teams","hooks_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/hooks","issue_events_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/issues/events{/number}","events_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/events","assignees_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/assignees{/user}","branches_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/branches{/branch}","tags_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/tags","blobs_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/statuses/{sha}","languages_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/languages","stargazers_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/stargazers","contributors_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/contributors","subscribers_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/subscribers","subscription_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/subscription","commits_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/contents/{+path}","compare_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/merges","archive_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/downloads","issues_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/issues{/number}","pulls_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/pulls{/number}","milestones_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/milestones{/number}","notifications_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/labels{/name}","releases_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/releases{/id}","deployments_url":"https://api.github.com/repos/angular-esx/ngx-bootstrap/deployments","created_at":"2016-02-01T17:03:45Z","updated_at":"2016-02-06T11:35:24Z","pushed_at":"2016-03-01T17:07:59Z","git_url":"git://github.com/angular-esx/ngx-bootstrap.git","ssh_url":"git@github.com:angular-esx/ngx-bootstrap.git","clone_url":"https://github.com/angular-esx/ngx-bootstrap.git","svn_url":"https://github.com/angular-esx/ngx-bootstrap","homepage":null,"size":48,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular-esx/ngx-bootstrap/pulls/9"},"html":{"href":"https://github.com/angular-esx/ngx-bootstrap/pull/9"},"issue":{"href":"https://api.github.com/repos/angular-esx/ngx-bootstrap/issues/9"},"comments":{"href":"https://api.github.com/repos/angular-esx/ngx-bootstrap/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/angular-esx/ngx-bootstrap/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/angular-esx/ngx-bootstrap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular-esx/ngx-bootstrap/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/angular-esx/ngx-bootstrap/statuses/f504cb43f5c0e6f344f35c37d6afcbf7ce133388"}}}}