Giter Site home page Giter Site logo

autonumeric's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

autonumeric's Issues

issue with reactive forms

Hello,

We are using this control with reactive forms (formControlName). We create a form and pass a value with the form control. Whenever we want to adapt the value through reactive forms by changing the value outside the user interface it doesn't seem to work. Could it be that there is still a problem with reactive forms?

In the code I can see that writeValue receives an object, but nothing is done with it...

writeValue(obj: any): void { if (this.instance) { this.internal = this.instance.getFormatted(); } }

Kind regards,
Peters Stephan

issue with disable state in reactive forms

Hi,

Using reactive form I'm unable to handle disable status with ngAutonumeric directive.
I added some disabled functionalities to Davide-a11y's stackblitz I found in issue: #2
https://stackblitz.com/edit/angular-fqwruy
While pressing "Disable/Enable fields", the whole form should be disabled.
However it doesn't disable with "Salary"-field.
And I tried a workaround ("Salary html disable property binding"-field) with [disabled] property binding but that isn't work either.

Regards,
Aki Kesulahti

Generic type 'ModuleWithProviders<T>' requires 1 type argument(s).

Hi guys,
We actually migratig our library to Angular V10 but we encouter a problem with your library :-/

Compiling TypeScript sources through ngc
ERROR: projects/.../.../node_modules/@angularfy/autonumeric/lib/autonumeric.module.d.ts:7:56 - error TS2314: Generic type 'ModuleWithProviders<T>' requires 1 type argument(s).

7     static forRoot(userDefaults?: AutonumericOptions): ModuleWithProviders;

It's actually caused by a non compatibility... could you please fixe it ? :-)

thx

ngAutonumeric with FormControl: pasting a number sets value of FormControl to null

Using ngAutonumeric with decimal character ',' in combination with a FormControl:

  • typing a number into the input field behind the decimal character returns the number as value of the FormControl
  • pasting the same number with ctrl+v into the input field behind the decimal character returns null as value of the FormControl (is expected to return the pasted number instead)

Details can be checked out here:
https://stackblitz.com/edit/angular-sttvux?file=src/app/app.component.ts

Problem when importing

I was trying to import it but looks like my project is suffering a little bit, it compiles correctly for angular4 but on runtime I get:

Unexpected value 'NgAutonumericModule' imported by the module ...

any suggestion?

The form value is only updated when the user clicks away

Expected Behavior

The form value should be updated whenever there's a change to the field

Current Behavior

The form value is being updated whenever the user clicks away from the field.

Possible Solution

An option in the directive which enables direct changes to the ngModel

Steps to Reproduce

A demo of the issue can be found here: Stackblitz

  1. Modify the field.
  2. Notice how the span is empty until you click away
  3. Click away
  4. Span gets updated with the input value

Context (Environment)

I have a page with just 1 field (this autonumeric field). When the user enters a value, I need to:

  1. Show an updated amount right below the field
  2. Check validation of a button in a form and enable/disable accordingly

Since the ngModel is not updated with changes, from the user, there is no easy way to verify changes.

Detailed Description

Possible Implementation

Current:

<input [ngAutonumeric]="{
currencySymbol: '\u00a0€',
minimumValue: '0'
}" [(ngModel)]="myModel" (format)="onFormat($event)"/>

New:

<input [ngAutonumeric]="{currencySymbol: '\u00a0€', minimumValue: '0'}"
updateOnChanges
[(ngModel)]="myModel" (format)="onFormat($event)"/>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.