Iva Pesa
Iva Pesa

Reputation: 47

How to use cordova-plugin-datepicker in ionic app

I don't know how to use cordova-plugin-datepicker https://github.com/VitaliiBlagodir/cordova-plugin-datepicker in ionic app, I mean which import to add and where, which variable to declare and which object to call. I tried to follow the instructions on github but is not clear. Thank everyone that responds

Upvotes: 0

Views: 389

Answers (1)

Buzzinga
Buzzinga

Reputation: 401

  1. Install the plugin.
  2. Go to the related ionic page you want to use the plugin with.
  3. Declare the plugin right after the imports like this : declare const datePicker
  4. Now you can use it in your page. Example usage : datePicker.show(options, onSuccess, onError); as described in the plugin home page.

NOTE: If you check any DatePicker.js file in here, you will see how it is exported at the end of the file.

Upvotes: 1

Related Questions