ng-flatpickerr

1.0.3 • Public • Published

ng-flatpicker

Angularjs directive for flatpickr.Pleas do the following to use ng-flatpicker.

  • just add ng-flatpicker to your input.Default dateformat is Y-m-d.
  • You can specify alot of options. To do that just add options attribute object in your element.

Prerequires

Before installation you must to include flatpickr to your project.

Installation

Install with npm

  npm i ng-flatpickerr

After run the above command

  • Include ng-flatpicker.min.js to your project.
  • And then add ng-flatpicker modules to your angularjs application.

Example

var myapp = angular.module("myapp", ["ng-flatpicker"]);

Usage

To use ng-flatpicker you just need add ng-flatpicker attribute and options to your element.

<input
  type="text"
  ng-flatpicker
  options="{dateFormat:'Y-m-d'}"
  placeholder="Select a date"
  ng-model="demoDate"
/>

Example with angularjs

Define options to your controller.

var myapp = angular.module("myapp", ["ng-flatpicker"]);
 
angular.module("myapp").controller("demoCtrl", function($scope) {
  $scope.options = {
    dateFormat: "Y-m-d",
    enabledTime: true
  };
});

and then to your view file

<input
  type="text"
  ng-flatpicker
  options="options"
  placeholder="Select a date"
  ng-model="demoDate"
/>

Note: Need to deine ng-model in your element.

License

ng-flatpicker module is under MIT license see project root

Package Sidebar

Install

npm i ng-flatpickerr

Weekly Downloads

5

Version

1.0.3

License

ISC

Unpacked Size

9.87 kB

Total Files

7

Last publish

Collaborators

  • larmaysee