0.0.9 • Published 7 years ago

example-library-datepicker v0.0.9

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Ic Datepicker

Docs & Example

Warning: This component is still in pre-release. Although the component should be stable, until v1 is released there is potential for API changes whilst things are finalised. To prevent issues, ensure your package.json file specifies a specific version (e.g. "ic-datepicker": "0.0.5").

Installation

Install the component via NPM;

npm install -S ic-datepicker

Import the IcDatepickerModule into your module;

// app.module.ts

import { IcDatepickerModule } from 'ic-datepicker/dist';

@NgModule({
  imports: [
    IcDatepickerModule,
  ],
})

Usage

Use the <ic-datepicker/> element, optionally providing an IcDatepickerOptionsInterface instance containing overriding options (see defaults).

import { IcDatepickerOptionsInterface } from 'ic-datepicker/dist';

@Component({
  selector: 'my-example-component',
  template: `
    <form [formGroup]="exampleForm">
      <ic-datepicker formControlName="datepicker" options="datepickerOptions"></ic-datepicker>
    </form>
  `,
  styles: ``
})
export class MyExampleComponent implements OnInit {
  this.datepickerOptions: IcDatepickerOptionsInterface;
  this.exampleForm: FormGroup;
  
  ngOnInit() {
    this.datepickerOptions = {
      position: 'top'
    };
  
    this.exampleForm = new FormGroup({
      datepicker: new FormControl()
    });
  }
}