Skip to content

Getting started

Fetrarijaona R edited this page Mar 30, 2018 · 1 revision
  1. Run npm install ngx-daterangepicker-material --save
  2. import NgxDaterangepickerMd to your @NgModule like example below
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { App } from './app';
import { NgxDaterangepickerMd } from 'ngx-daterangepicker-material';
 
@NgModule({
    imports:      [BrowserModule, FormsModule, NgxDaterangepickerMd],
    declarations: [App],
    bootstrap:    [App]
})
export class AppModule {}
  1. Use it in our component:
@Component({
  selector: 'ngx-root',
  template: `<input type="text" ngxDaterangepickerMd [(ngModel)]="selected" class="form-control"/>`
})

export class AppComponent {
    selected = {startDate: moment(), endDate: moment().add('3', 'days')};
}
Clone this wiki locally