Skip to content
This repository was archived by the owner on Apr 30, 2018. It is now read-only.

Number Input is broken with Angular 1.3.3 #130

Closed
Bill77 opened this issue Nov 19, 2014 · 7 comments
Closed

Number Input is broken with Angular 1.3.3 #130

Bill77 opened this issue Nov 19, 2014 · 7 comments

Comments

@Bill77
Copy link

Bill77 commented Nov 19, 2014

In case others ran into this issue, I figured I'd post since it took a while for me to figure it out. Basically if you're running Formly with Angular 1.3.x the numeric inputs will not be updated to the ng-model because they are invalid. It seems that their ng-maxlength gets set to 0 by default. If you set an explicit value this fixes the issue, although it's not ideal.

This issue seems to be part of what Angular is doing (setting maxlength to 0 if it's null) along with how Formly is setting the maxlength (by default if maxlength is not specified, the attribute is still set to null). It should hopefully be fixed in 1.3.4, although I have not tested the PR yet.

Thanks,
Bill

Here is the link to the Angular pull request for 1.3.4:
angular/angular.js#9998

Example of what I'm talking about;
http://plnkr.co/edit/SJY6CofpRMhvPAo9hHpu

@kentcdodds
Copy link
Member

Thank you. This is great news that it'll be fixed (hopefully) in 1.3.4 :-)

@Bill77
Copy link
Author

Bill77 commented Nov 26, 2014

Hey @kentcdodds,

Just wanted to let you know I just tested 1.3.4 and the number and maxlength issue is fixed.

Bill

@Bill77 Bill77 closed this as completed Nov 26, 2014
@kentcdodds
Copy link
Member

👏

@sucheendra
Copy link

I am new to angular and formly, however I am using heavily angular formly. I will get stuck in ever new requirement.

  1. I am having hard time to set input type control to allow only decimal value how do I achieve this? I don’t want user enter text when it currency field.
  2. Second I have dialog opens from main page where the validator function triggers however I don’t see any visual indication (Color change in control).

@sucheendra
Copy link

your help is much appreciated if these things not get solved I need to write all the page in plain html with angular, which I don't want to do. Please help me.

@kentcdodds
Copy link
Member

Hi @sucheendra, the best way to get help is to follow the instructions here: http://help.angular-formly.com

For your first question, you'll simply set the type property in templateOptions to number and that should do it for you.

For your second question, please go to that help link and create an example of what you mean.

@sucheendra
Copy link

It helped

Thank you Kent,

Thanks & Regards,
Suchi

On Mon, Oct 5, 2015 at 11:08 AM, Kent C. Dodds notifications@github.com
wrote:

Hi @sucheendra https://github.com/sucheendra, the best way to get help
is to follow the instructions here: http://help.angular-formly.com

For your first question, you'll simply set the type property in
templateOptions to number and that should do it for you.

For your second question, please go to that help link and create an
example of what you mean.


Reply to this email directly or view it on GitHub
#130 (comment)
.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants