Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rajivnarayana/nativescripttimepickersliderplugin


https://github.com/rajivnarayana/nativescripttimepickersliderplugin

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# NativeScript date picker slider plugin

A plugin that enables you to use the cocoapod at https://github.com/rajivnarayana/TimePickerSlider in your native script app.

## Installation

Run the following command from the root of your project

```
$ tns plugin add https://github.com/rajivnarayana/NativeScriptTimePickerSliderPlugin.git
```

This command automatically install the necessary ios files from the cocoapod github repository and adds as a dependency in your package.json file

## Examples

There is an sample application at the folder "Example". To run it (assuming you have nativescript plugin installed globally)

```
$ sudo npm install typescript -g
$ tsc
$ cd Example
$ tns plugin add ../
```

Run the application from your mac onto your iOS simulator by typing
```
$ tns emulate ios --device=iPhone\ 5s
```

The following code from Example/app/main.xml show you a way to add Time picker to your layout
```xml



```
Following code from Exaple/app/main.js shows a way to listen to value changes

```js
function onSliderLoaded(args) {
var slider = args.object;
slider.on(observableModule.Observable.propertyChangeEvent, (args) => {
if (args.propertyName == sliderModule.Slider.valueProperty.name) {
console.log('Do something with the data '+slider.value);
}
}, this);
}

exports.onSliderLoaded = onSliderLoaded;
```