Angular 4 Directive
To install this library, run:
$ npm install ng-sticky --saveImport library in any Angular 4 application by running:
$ npm install ng-stickyand then from your Angular AppModule:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
// Import NgStickyDirective
import { NgStickyDirective } from 'ng-sticky';
@NgModule({
declarations: [
AppComponent,
NgStickyDirective
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }Once the library is imported, you can use the directive:
<div ng-sticky [offSet]="0" [addClass]="'is-sticky'">
<div>menu</div>
</div>To generate all *.js, *.d.ts and *.metadata.json files:
$ npm run buildTo lint all *.ts files:
$ npm run lintMIT © Jonas Medeiros