# ngx-amazing-time-picker

> [![npm](https://img.shields.io/npm/v/ngx-amazing-time-picker)](https://www.npmjs.com/package/ngx-amazing-time-picker) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/ndraiman/ngx-amazing-time-picker

Latest version **17.0.1** (published 2024-01-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngx-amazing-time-picker
pnpm add ngx-amazing-time-picker
yarn add ngx-amazing-time-picker
bun add ngx-amazing-time-picker
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 17.0.1 |
| Published | 2024-01-21 |
| First published | 2022-06-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 262.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Netanel Draiman |
| Maintainers | nexaddo |

## Links

- npm: https://www.npmjs.com/package/ngx-amazing-time-picker
- Repository: https://github.com/ndraiman/ngx-amazing-time-picker
- Homepage: https://github.com/ndraiman/ngx-amazing-time-picker#readme
- Issues: https://github.com/ndraiman/ngx-amazing-time-picker/issues
- npm.io page: https://npm.io/package/ngx-amazing-time-picker

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.3.0

## Recent versions

- 17.0.1 (latest) — 2024-01-21
- 17.0.0 — 2024-01-21
- 16.0.0 — 2024-01-21
- 15.0.1 — 2023-02-07
- 0.0.0 — 2023-02-07
- 15.0.0 — 2023-02-07
- 14.0.0 — 2022-06-20
- 13.0.0 — 2022-06-20
- 12.0.0 — 2022-06-20

## README

# NgxAmazingTimePicker

[![npm](https://img.shields.io/npm/v/ngx-amazing-time-picker)](https://www.npmjs.com/package/ngx-amazing-time-picker)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/ndraiman/ngx-amazing-time-picker/master/LICENSE.md)

Updated [AmazingTimePicker](https://github.com/owsolutions/amazing-time-picker) library to work with recent angular versions

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/ndraiman/ngx-amazing-time-picker/tree/v17.0.0?file=src%2Fapp%2Fapp.component.ts)

---

## Install
You need to install this repository as dependency and import it to your `app.module.ts` in `imports` section.

```console
npm install ngx-amazing-time-picker --save
```

then, open your `app.module.ts` or other module that you want to use timepicker among, and import and add it to the `imports` section:

```ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AmazingTimePickerModule } from 'ngx-amazing-time-picker'; // <===
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AmazingTimePickerModule // <===
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
```

## Using in component markup

You can use it within your html templates and add the `atp-time-picker` directive to the `<input>` tag.
Clicking the input will open the timepicker dialog
When the dialog is closed, it'll update the input value.

```html
<input atp-time-picker value="19:00"/>
```

## Opening component programmatically
You can also open a timepicker dialog programmatically. In order to open that, you need to import the service in your component:

```ts
import { AmazingTimePickerService } from 'ngx-amazing-time-picker';
```

Then add it inside your `app.component.ts` or any other component, for example:

```ts
import { Component } from '@angular/core';
import { AmazingTimePickerService } from 'ngx-amazing-time-picker'; // <===
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  
  constructor(private atp: AmazingTimePickerService) {} // <===
  
  open() {
    this.atp.open()
      .afterClose()
      .subscribe(value => {
        this.timeForm.setValue(value);
      });
  }
}
```

---
_Source: https://npm.io/package/ngx-amazing-time-picker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
