Angular Material时间选择器

Angular Material时间选择器
插件名称 amazing-time-picker
发布时间 2020年7月15日
插件作者 owsolutions

Angular Material应用程序的另一个时钟样式的时间选择器组件。

安装:

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

用法:

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>