<commit_before>import {
  Directive, ElementRef, HostBinding, EventEmitter,
  Input, Output, OnDestroy, AfterViewInit,
  ChangeDetectorRef, NgZone, Inject
} from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { fromEvent } from 'rxjs/observable/fromEvent';
import 'rxjs/add/operator/auditTime';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/takeUntil';
import 'rxjs/add/observable/merge';

import { WindowRef } from './window/window-ref.service';
import { Viewport } from './shared/viewport.model';
import * as eventData from './shared/event-data';

/**
 * A simple lightweight library for Angular (2+) with no
 * external dependencies that detects when an element is within the
 * browser viewport and adds a `in-viewport` or `not-in-viewport` class
 * to the element.
 *
 * @example
 * ```html
 * <p
 *  class="foo"
 *  snInViewport
 *  (inViewportChange)="myEventHandler($event)"
 *  [debounce]="300">
 *  Amet tempor excepteur occaecat nulla.
 * </p>
 * ```
 */
@Directive({
  selector: '[snInViewport]'
})
export class InViewportDirective implements AfterViewInit, OnDestroy {
  /**
   * If true means the element is in the browser viewport
   *
   * @memberof InViewportDirective
   */
  private inViewport: boolean;
  /**
   * Observable that returns the size of the viewport
   *<commit_msg>docs: remove rouge reference to angular 2<commit_after>import {
  Directive, ElementRef, HostBinding, EventEmitter,
  Input, Output, OnDestroy, AfterViewInit,
  ChangeDetectorRef, NgZone, Inject
} from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { fromEvent } from 'rxjs/observable/fromEvent';
import 'rxjs/add/operator/auditTime';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/takeUntil';
import 'rxjs/add/observable/merge';

import { WindowRef } from './window/window-ref.service';
import { Viewport } from './shared/viewport.model';
import * as eventData from './shared/event-data';

/**
 * A simple lightweight library for Angular with no
 * external dependencies that detects when an element is within the
 * browser viewport and adds a `in-viewport` or `not-in-viewport` class
 * to the element.
 *
 * @example
 * ```html
 * <p
 *  class="foo"
 *  snInViewport
 *  (inViewportChange)="myEventHandler($event)"
 *  [debounce]="300">
 *  Amet tempor excepteur occaecat nulla.
 * </p>
 * ```
 */
@Directive({
  selector: '[snInViewport]'
})
export class InViewportDirective implements AfterViewInit, OnDestroy {
  /**
   * If true means the element is in the browser viewport
   *
   * @memberof InViewportDirective
   */
  private inViewport: boolean;
  /**
   * Observable that returns the size of the viewport
   *
{'fraction_non_alphanumeric': 0.12692721405521692, 'fraction_numerical': 0.0028684116170670493, 'mean_word_length': 4.324427480916031, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '968004', 'n_tokens_mistral': 886, 'n_tokens_neox': 871, 'n_words': 251}