README
PersianSeperatedInput
Create seperated input which support persian numbers for iphone numeric keyboard. This library was generated with Angular CLI version 9.1.13.
Installation
npm install --save persian-seperated-input
Usage
Add PersianSeperatedInputModule to imports app.module.ts
like
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import {PersianSeperatedInputModule} from 'persian-seperated-input'
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
PersianSeperatedInputModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Add component to your page:
<psi-input (onInputChange)="onInputChange($event)" [digitOnly]="true"></psi-input>
Updating component value using setValue method
<psi-input #myInput (onInputChange)="onInputChange($event)"
[digitOnly]="true"></psi-input>
<button (click)="onClearClick()">clear</button>
then in your component reference using @ViewChild and call setValue method.
@ViewChild('myInput') myInput:any;
onClearClick(){
this.myInput.setValue('');
}
API
Name | Type | Required | default | Description |
---|---|---|---|---|
length | number | false | 5 | Number of inputs to be rendered |
digitOnly | boolean | false | false | show numeric keyboard on mobile devices |
InputValue | string | false | false | set init value into inputs |
FirstInputSelected | boolean | false | false | first input will be selected |