0.0.2 • Published 6 years ago

ngx-in-viewport v0.0.2

Weekly downloads
45
License
MIT
Repository
github
Last release
6 years ago

ngx-in-viewport

npm version

A simple Angular Directive to easily determine if a element in in the viewport.

Demo

Installation

To install this library, run:

npm install ngx-in-viewport --save

and then from your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { NgxInViewportModule } from 'ngx-in-viewport';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    NgxInViewportModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Component

Once the library is imported, you can use the ngx-debounce-click directive.

import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';

@Component({
  selector: 'app-root',
  template: `
  <div ngxInViewport (inViewport)="log($event)">
    Hello World!
  </div>
  `
})
export class AppComponent {
  log(event) {
    console.log(event);
  }
}

License

MIT © Cory Rylan

0.0.2

6 years ago

0.0.1

6 years ago

0.0.0

6 years ago