{"action":"created","comment":{"url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/comments/70162939","id":70162939,"diff_hunk":"@@ -0,0 +1,77 @@\n+import {\n+  Directive,\n+  ElementRef,\n+  Injectable,\n+  ContentChildren,\n+  QueryList,\n+  Input,\n+  OnDestroy,\n+  OnInit,\n+  Renderer,\n+  Component,\n+  TemplateRef,\n+  ViewContainerRef\n+} from '@angular/core';\n+import {toInteger} from '../util/util';\n+\n+let spies = new Set<NgbScrollSpy>();\n+\n+@Directive({selector: '[ngbScrollSpy]', host: {'(click)': 'activateOnClick()'}})\n+export class NgbScrollSpy implements OnDestroy, OnInit {\n+  @Input('ngbScrollSpy') selector: string | TemplateRef<any>;\n+\n+  private _activeTarget;\n+\n+  constructor(public elementRef: ElementRef, private renderer: Renderer) {}\n+\n+  ngOnDestroy(): void { spies.delete(this); }\n+\n+  ngOnInit(): void { spies.add(this); }\n+\n+  setActive(target: HTMLElement) {\n+    let element = this.elementRef.nativeElement;\n+    this.renderer.setElementClass(element, 'active', target.id === this.selector);\n+  }\n+\n+  activateOnClick() {\n+    spies.forEach(\n+        spy => this.renderer.setElementClass(spy.elementRef.nativeElement, 'active', spy.selector === this.selector));\n+  }\n+}\n+\n+@Directive({selector: '[ngbScrollTarget]'})\n+export class NgbScrollTarget implements OnInit {\n+  private _scrollHeight: number = 0;\n+  private _offsetList: any[] = [];\n+  constructor(private elementRef: ElementRef, private renderer: Renderer, private _viewContainerRef: ViewContainerRef) {","path":"src/scrollspy/scrollspy.ts","position":46,"original_position":46,"commit_id":"383f5c9c3fdad0118240ee3f1634f3afdbf514e9","original_commit_id":"383f5c9c3fdad0118240ee3f1634f3afdbf514e9","user":{"login":"pkozlowski-opensource","id":973550,"avatar_url":"https://avatars.githubusercontent.com/u/973550?v=3","gravatar_id":"","url":"https://api.github.com/users/pkozlowski-opensource","html_url":"https://github.com/pkozlowski-opensource","followers_url":"https://api.github.com/users/pkozlowski-opensource/followers","following_url":"https://api.github.com/users/pkozlowski-opensource/following{/other_user}","gists_url":"https://api.github.com/users/pkozlowski-opensource/gists{/gist_id}","starred_url":"https://api.github.com/users/pkozlowski-opensource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkozlowski-opensource/subscriptions","organizations_url":"https://api.github.com/users/pkozlowski-opensource/orgs","repos_url":"https://api.github.com/users/pkozlowski-opensource/repos","events_url":"https://api.github.com/users/pkozlowski-opensource/events{/privacy}","received_events_url":"https://api.github.com/users/pkozlowski-opensource/received_events","type":"User","site_admin":false},"body":"Why do we have `_viewContainerRef`? It doesn't seem to be used?","created_at":"2016-07-09T05:29:33Z","updated_at":"2016-07-09T05:29:33Z","html_url":"https://github.com/ng-bootstrap/ng-bootstrap/pull/394#discussion_r70162939","pull_request_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/394","_links":{"self":{"href":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/comments/70162939"},"html":{"href":"https://github.com/ng-bootstrap/ng-bootstrap/pull/394#discussion_r70162939"},"pull_request":{"href":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/394"}}},"pull_request":{"url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/394","id":76716511,"html_url":"https://github.com/ng-bootstrap/ng-bootstrap/pull/394","diff_url":"https://github.com/ng-bootstrap/ng-bootstrap/pull/394.diff","patch_url":"https://github.com/ng-bootstrap/ng-bootstrap/pull/394.patch","issue_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/issues/394","number":394,"state":"open","locked":false,"title":"feat(scrollspy): added scrollspy and its demo","user":{"login":"sendilkumarn","id":12471122,"avatar_url":"https://avatars.githubusercontent.com/u/12471122?v=3","gravatar_id":"","url":"https://api.github.com/users/sendilkumarn","html_url":"https://github.com/sendilkumarn","followers_url":"https://api.github.com/users/sendilkumarn/followers","following_url":"https://api.github.com/users/sendilkumarn/following{/other_user}","gists_url":"https://api.github.com/users/sendilkumarn/gists{/gist_id}","starred_url":"https://api.github.com/users/sendilkumarn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sendilkumarn/subscriptions","organizations_url":"https://api.github.com/users/sendilkumarn/orgs","repos_url":"https://api.github.com/users/sendilkumarn/repos","events_url":"https://api.github.com/users/sendilkumarn/events{/privacy}","received_events_url":"https://api.github.com/users/sendilkumarn/received_events","type":"User","site_admin":false},"body":"Before submitting a pull request, please make sure you have at least performed the following:\r\n\r\n - [X] read and followed the [CONTRIBUTING.md](https://github.com/ng-bootstrap/core/blob/master/CONTRIBUTING.md) guide.\r\n - [X] built and tested the changes locally.\r\n - [X] added/updated any applicable tests.\r\n - [X] added/updated any applicable API documentation.\r\n - [X] added/updated any applicable demos.\r\n\r\nfixes #5 \r\n\r\n","created_at":"2016-07-08T08:16:15Z","updated_at":"2016-07-09T05:29:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5591f78594d6f08d0bb03f2083e31900cb2ee11d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/394/commits","review_comments_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/394/comments","review_comment_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/issues/394/comments","statuses_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/statuses/383f5c9c3fdad0118240ee3f1634f3afdbf514e9","head":{"label":"sendilkumarn:scrollspy","ref":"scrollspy","sha":"383f5c9c3fdad0118240ee3f1634f3afdbf514e9","user":{"login":"sendilkumarn","id":12471122,"avatar_url":"https://avatars.githubusercontent.com/u/12471122?v=3","gravatar_id":"","url":"https://api.github.com/users/sendilkumarn","html_url":"https://github.com/sendilkumarn","followers_url":"https://api.github.com/users/sendilkumarn/followers","following_url":"https://api.github.com/users/sendilkumarn/following{/other_user}","gists_url":"https://api.github.com/users/sendilkumarn/gists{/gist_id}","starred_url":"https://api.github.com/users/sendilkumarn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sendilkumarn/subscriptions","organizations_url":"https://api.github.com/users/sendilkumarn/orgs","repos_url":"https://api.github.com/users/sendilkumarn/repos","events_url":"https://api.github.com/users/sendilkumarn/events{/privacy}","received_events_url":"https://api.github.com/users/sendilkumarn/received_events","type":"User","site_admin":false},"repo":{"id":61553170,"name":"core","full_name":"sendilkumarn/core","owner":{"login":"sendilkumarn","id":12471122,"avatar_url":"https://avatars.githubusercontent.com/u/12471122?v=3","gravatar_id":"","url":"https://api.github.com/users/sendilkumarn","html_url":"https://github.com/sendilkumarn","followers_url":"https://api.github.com/users/sendilkumarn/followers","following_url":"https://api.github.com/users/sendilkumarn/following{/other_user}","gists_url":"https://api.github.com/users/sendilkumarn/gists{/gist_id}","starred_url":"https://api.github.com/users/sendilkumarn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sendilkumarn/subscriptions","organizations_url":"https://api.github.com/users/sendilkumarn/orgs","repos_url":"https://api.github.com/users/sendilkumarn/repos","events_url":"https://api.github.com/users/sendilkumarn/events{/privacy}","received_events_url":"https://api.github.com/users/sendilkumarn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sendilkumarn/core","description":"Angular 2 powered Bootstrap","fork":true,"url":"https://api.github.com/repos/sendilkumarn/core","forks_url":"https://api.github.com/repos/sendilkumarn/core/forks","keys_url":"https://api.github.com/repos/sendilkumarn/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sendilkumarn/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sendilkumarn/core/teams","hooks_url":"https://api.github.com/repos/sendilkumarn/core/hooks","issue_events_url":"https://api.github.com/repos/sendilkumarn/core/issues/events{/number}","events_url":"https://api.github.com/repos/sendilkumarn/core/events","assignees_url":"https://api.github.com/repos/sendilkumarn/core/assignees{/user}","branches_url":"https://api.github.com/repos/sendilkumarn/core/branches{/branch}","tags_url":"https://api.github.com/repos/sendilkumarn/core/tags","blobs_url":"https://api.github.com/repos/sendilkumarn/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sendilkumarn/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sendilkumarn/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/sendilkumarn/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sendilkumarn/core/statuses/{sha}","languages_url":"https://api.github.com/repos/sendilkumarn/core/languages","stargazers_url":"https://api.github.com/repos/sendilkumarn/core/stargazers","contributors_url":"https://api.github.com/repos/sendilkumarn/core/contributors","subscribers_url":"https://api.github.com/repos/sendilkumarn/core/subscribers","subscription_url":"https://api.github.com/repos/sendilkumarn/core/subscription","commits_url":"https://api.github.com/repos/sendilkumarn/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/sendilkumarn/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/sendilkumarn/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/sendilkumarn/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/sendilkumarn/core/contents/{+path}","compare_url":"https://api.github.com/repos/sendilkumarn/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sendilkumarn/core/merges","archive_url":"https://api.github.com/repos/sendilkumarn/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sendilkumarn/core/downloads","issues_url":"https://api.github.com/repos/sendilkumarn/core/issues{/number}","pulls_url":"https://api.github.com/repos/sendilkumarn/core/pulls{/number}","milestones_url":"https://api.github.com/repos/sendilkumarn/core/milestones{/number}","notifications_url":"https://api.github.com/repos/sendilkumarn/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sendilkumarn/core/labels{/name}","releases_url":"https://api.github.com/repos/sendilkumarn/core/releases{/id}","deployments_url":"https://api.github.com/repos/sendilkumarn/core/deployments","created_at":"2016-06-20T14:17:52Z","updated_at":"2016-06-20T14:17:53Z","pushed_at":"2016-07-08T10:49:53Z","git_url":"git://github.com/sendilkumarn/core.git","ssh_url":"git@github.com:sendilkumarn/core.git","clone_url":"https://github.com/sendilkumarn/core.git","svn_url":"https://github.com/sendilkumarn/core","homepage":null,"size":477,"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":"ng-bootstrap:master","ref":"master","sha":"3e15fb48bba43e02efe6e7beb8e76852afbe5229","user":{"login":"ng-bootstrap","id":14283866,"avatar_url":"https://avatars.githubusercontent.com/u/14283866?v=3","gravatar_id":"","url":"https://api.github.com/users/ng-bootstrap","html_url":"https://github.com/ng-bootstrap","followers_url":"https://api.github.com/users/ng-bootstrap/followers","following_url":"https://api.github.com/users/ng-bootstrap/following{/other_user}","gists_url":"https://api.github.com/users/ng-bootstrap/gists{/gist_id}","starred_url":"https://api.github.com/users/ng-bootstrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ng-bootstrap/subscriptions","organizations_url":"https://api.github.com/users/ng-bootstrap/orgs","repos_url":"https://api.github.com/users/ng-bootstrap/repos","events_url":"https://api.github.com/users/ng-bootstrap/events{/privacy}","received_events_url":"https://api.github.com/users/ng-bootstrap/received_events","type":"Organization","site_admin":false},"repo":{"id":42481664,"name":"ng-bootstrap","full_name":"ng-bootstrap/ng-bootstrap","owner":{"login":"ng-bootstrap","id":14283866,"avatar_url":"https://avatars.githubusercontent.com/u/14283866?v=3","gravatar_id":"","url":"https://api.github.com/users/ng-bootstrap","html_url":"https://github.com/ng-bootstrap","followers_url":"https://api.github.com/users/ng-bootstrap/followers","following_url":"https://api.github.com/users/ng-bootstrap/following{/other_user}","gists_url":"https://api.github.com/users/ng-bootstrap/gists{/gist_id}","starred_url":"https://api.github.com/users/ng-bootstrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ng-bootstrap/subscriptions","organizations_url":"https://api.github.com/users/ng-bootstrap/orgs","repos_url":"https://api.github.com/users/ng-bootstrap/repos","events_url":"https://api.github.com/users/ng-bootstrap/events{/privacy}","received_events_url":"https://api.github.com/users/ng-bootstrap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ng-bootstrap/ng-bootstrap","description":"Angular 2 powered Bootstrap","fork":false,"url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap","forks_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/forks","keys_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/teams","hooks_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/hooks","issue_events_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/issues/events{/number}","events_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/events","assignees_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/assignees{/user}","branches_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/branches{/branch}","tags_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/tags","blobs_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/git/refs{/sha}","trees_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/statuses/{sha}","languages_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/languages","stargazers_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/stargazers","contributors_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/contributors","subscribers_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/subscribers","subscription_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/subscription","commits_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/commits{/sha}","git_commits_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/git/commits{/sha}","comments_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/comments{/number}","issue_comment_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/issues/comments{/number}","contents_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/contents/{+path}","compare_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/merges","archive_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/downloads","issues_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/issues{/number}","pulls_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls{/number}","milestones_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/milestones{/number}","notifications_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/labels{/name}","releases_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/releases{/id}","deployments_url":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/deployments","created_at":"2015-09-14T22:55:53Z","updated_at":"2016-07-09T04:10:51Z","pushed_at":"2016-07-09T05:15:59Z","git_url":"git://github.com/ng-bootstrap/ng-bootstrap.git","ssh_url":"git@github.com:ng-bootstrap/ng-bootstrap.git","clone_url":"https://github.com/ng-bootstrap/ng-bootstrap.git","svn_url":"https://github.com/ng-bootstrap/ng-bootstrap","homepage":"https://ng-bootstrap.github.io","size":677,"stargazers_count":492,"watchers_count":492,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":78,"mirror_url":null,"open_issues_count":26,"forks":78,"open_issues":26,"watchers":492,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/394"},"html":{"href":"https://github.com/ng-bootstrap/ng-bootstrap/pull/394"},"issue":{"href":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/issues/394"},"comments":{"href":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/issues/394/comments"},"review_comments":{"href":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/394/comments"},"review_comment":{"href":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/pulls/394/commits"},"statuses":{"href":"https://api.github.com/repos/ng-bootstrap/ng-bootstrap/statuses/383f5c9c3fdad0118240ee3f1634f3afdbf514e9"}}}}
{"actor":{"display_login":"pkozlowski-opensource"}}