An ionic/angular time picker (spinner) which is developed in web technologies but looks similar to native.
- Angular 1.*
- Add CSS and JS to project:
<link rel="stylesheet" href="wherever-you-put-it/ionTimePicker.min.css">
<script type="text/javascript" src="wherever-you-put-it/ionTimePicker.min.js"></script>
Add dependencies on the ion-time-picker
AngularJS module:
angular.module('myApp', ['ion-pickers']);
You can now use the directive, add the attribute to your existing DOM element in HTML:
<input type="text" ng-model="value.time" ion-time-picker>
id (optional)
- Give a unique id to the bound element and drawer will be named {{id}}-drawerng-model
(optional) - string. Define the model to bind the selected value to. the value of the model is displayed once drawer is open.ng-change
(optional) - method called after the value has been setsensitivity (optional)
- Define the scroll sensitivitystep
(optional) - The distance between two displayed values for minutes, default is 5 minutesopenPartScreenDrawerBarrier (optional)
- define the device height in pixels where any value higher than it will open drawer partially and not full screen. use 0 to always open as parital drawer. default is 420pxngDefault
(optional) - if ng-model is null then time selector open on this time as selected. If displaying with AM/PM format is of type: HH:MM AAcontrol
(optional) - control element to control directive from outside (see notes for details)hasClear
(optional) - Whether drawer has clear button or not, if does value set to zeroisWithDaytime
(optional) - Is hour with AM/PM of 24H display. If not set uses browser settingdeleteOnClose
(optional) - Whether to remove DOM elements and event registration on close of drawer. Better user with many drawers that have a large number of elements Default is falseonSet
(optional) - event fired when set button clicked, model is set value. Has two params oldValue and newValue, If returning false from method set canceled. IMPORTANT: only pass method name without bracketsonCancel
(optional) - event fired when cancel button clicked. IMPORTANT: only pass method name without bracketsonClear
(optional) - event fired when clear button clicked. IMPORTANT: only pass method name without brackets
Valid values:
- Step must be a valid positive integer number under 60
- Control methods which can be called:
openDrawer
- opens the time select drawercloseDrawer
- closes the time select drawergetCurrentSelection
- returns the current value displayed as selected in time select drawerisDrawerOpen
- is the drawer currently open or notprepareDom
- use to manually issue a creation of DOM elements which can be costly. Will do nothing if DOM element already exists.
Upon purchase you'll receive a minimized js file and minimized css for immediate use
Use only by person/business specified in payment for one or more end products TODO