npm.io
0.0.1 • Published 4 years ago

cmyd-input-comma

Licence
—
Version
0.0.1
Deps
1
Size
39 kB
Vulns
0
Weekly
0

CmydInputComma

This library was generated with Angular CLI version 12.2.0.

Overview

CmydInputComma Docs

  • valueChange Emits a number value.
  • value Used for providng value.

This is how you will use with a number variable


<input 
    type="text"
    cmydComma
    (valueChange)="SomeNumberVariable" />

CmydInputComma Since we can't use formControl with directive attached, we do it like this.

This is how you will use with a formControl


<input 
    type="text"
    cmydComma
    (valueChange)="form.get('control')?.setValue($event)" />

<input 
    formControlName="control"
    hidden
    type="number" />

Or you can use it like this

<input 
    type="text"
    cmydComma
    [disabled]="form.get('control')?.disabled"
    [value]="form.get('control')?.value"
    (valueChange)="form.get('control')?.setValue($event)" />

<input 
    formControlName="control"
    hidden
    type="number" />

Version

0.0.1 Initial commit

That's it,

Further help

If you found a bug or know a better way of doing it please do reach me out at hamza13sw185@gmail.com.

Keywords