Angular Material Clock Time Picker

Author: owsolutions
Publish Date:
Official Page: Go to website
Views Total: 64
License: MIT

Description:

Just another clock-style time picker component for Angular Material 5+ app.

Installation:

# NPM
$ npm install angular-material-clock-time-picker --save

Usage:

app.module.ts:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { MatButtonModule, MatDialogModule, MatFormFieldModule, MatInputModule} from '@angular/material';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { AppComponent } from './app.component';
import { TimePickerComponent } from './time-picker/time-picker.component';
import { MatTimePickerDirective } from './time-picker/mat-timepicker.directive';

@NgModule({
  declarations: [
    AppComponent,
    TimePickerComponent,
    MatTimePickerDirective
  ],
  imports: [
    BrowserModule,
    MatButtonModule,
    MatFormFieldModule,
    BrowserAnimationsModule,
    MatDialogModule,
    MatInputModule
  ],
  providers: [],
  bootstrap: [
    AppComponent
  ],
  entryComponents: [
    TimePickerComponent
  ]
})
export class MatTimePickerModule { }

app.component.html:

<mat-form-field class="example-full-width">
  <input mat-timepicker matInput type="time" placeholder="Click to get the time" value="10:55 AM">
</mat-form-field>

Preview:

Angular Material Clock Time Picker

Leave a Reply