1.0.1 • Published 6 years ago
ngx-time-mask v1.0.1
Installation
First you need to install the npm module:
npm install ngx-time-mask --saveUsage
1. Import the ngx-time-mask:
Once installed you need to import the main module into your application module by importing NgxTimeMaskModule.
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { NgxTimeMaskModule } from 'ngx-time-mask';
@NgModule({
imports: [
BrowserModule,
NgxTimeMaskModule
],
bootstrap: [AppComponent]
})
export class AppModule { }2. Use the directive:
This is how you do it with the directive:
<input class="time-count" ngxTimeMask [(ngModel)]="data" (change)="onTimeChange($event)">And in your component define data (12:00 by default).
Contribute
ngx-time-mask is packaged with ng-packagr and then imported into an Angular CLI app.
To check the demo, click:
MIT © Avinash Maurya