Questions tagged [ng-messages]

Use for questions about the AngularJS ng-messages module.

Resources

170 questions
29
votes
1 answer

Angular dynamically set ng-messages to name attribute

I dynamically create inputs and want also validate every one of them but can't set correctly the ng-messages attribute to the field name property which is dynamically generated.
CSharpBeginner
  • 1,625
  • 5
  • 22
  • 36
28
votes
6 answers

Angular ng-messages: how to check password confirmation?

THE SITUATION: I am using ng-messages directive for instant validation in my angular app. Everything is working fine except one thing: i need to validate the field 'password confirmation' and don't know how to do. THE CODE:
FrancescoMussi
  • 20,760
  • 39
  • 126
  • 178
24
votes
10 answers

How do I reset a form including removing all validation errors?

I have an Angular form. The fields are validated using the ng-pattern attribute. I also have a reset button. I'm using the Ui.Utils Event Binder to handle the reset event like so:
battmanz
  • 2,266
  • 4
  • 23
  • 32
23
votes
3 answers

angularjs: ng-message always showing

I'm using angular-messages to display form validation errors on my angular app. As per the documentation, I have built the following code
15
votes
2 answers

Validate custom directive using ngMessages

I writing a web app in angularjs and using angular material (not sure if that is relevant to the question) and ngMessages to provide feedback for invalid inputs to the user. Usually, for validation of directives provided, I can validate in a way…
northsideknight
  • 1,519
  • 1
  • 15
  • 24
14
votes
4 answers

angular ng-messages only showing when $touched is true

I am not doing anything too special. I have an input I want validated with every key stroke. If validation fails, display the error. Do not wait for the blur event to trigger the $touched. I thought this was the default case, but apparently it is…
TyMayn
  • 1,936
  • 2
  • 18
  • 23
7
votes
1 answer

mdInput messages show animation called on invalid messages element:

Not sure why I'm getting the following message. Has anyone else encountered this in AngularJS/Angular Material? What am I doing wrong? The message itself seems a little vague. mdInput messages show animation called on invalid messages…
Trevor
  • 13,085
  • 13
  • 76
  • 99
6
votes
2 answers

How to show error messages for Checkbox set and Radio set using ng-messages?

I have been trying to validate Checkbox set and Radio set and show the error messages using ng-messages directive but it does not work out as expected. The ng-messages does not show the error message at all. I am populating error messages using an…
Devner
  • 6,825
  • 11
  • 63
  • 104
6
votes
1 answer

Angular translate directive not working with ngMessage

Simple input from an AngularJS example:
Alexander
  • 3,019
  • 1
  • 20
  • 24
5
votes
3 answers

How to add error into form validation error list in angular?

I'm using ng-messages to validate my registration form fields, but I have a problem, I can't check if username is taken, until I send registration request to server. Currently I have this type of code: UserPool.signUp(vm.form.username,…
GROX13
  • 4,605
  • 4
  • 27
  • 41
5
votes
0 answers

ngMessages and Nested Scopes - Datepicker in an ngForm on a Tab

OP Update I've figured out the problem and this issue is now closed. Would one day like to find the time to post the solution as an answer here. I'm having a bit of an issue working with ngMessages inside an ng-form on an Angular Bootstrap tab.…
onefootswill
  • 3,707
  • 6
  • 47
  • 101
5
votes
2 answers
5
votes
2 answers

ngMessages dont work inside a directives template

My ngMessages doesnt work inside my directives template! I have a directive myInput with a template and a link function, inside the template function I create template string for a wrapped
Lusk116
  • 791
  • 1
  • 6
  • 17
5
votes
3 answers

How to combine ng-message messages

I am new to AngularJS but I have searched extensively and could not find a working answer to this question, maybe its just not possible the way I have it in mind. What I would like is to be able to combine error conditions so that I can use more…
Igor
  • 60,821
  • 10
  • 100
  • 175
4
votes
1 answer

How can i validate form fields based on button click?

I have 3 buttons. 2 is inside ng-repeat and one outside ng-repeat so I want to show the required field alert if the user clicks these buttons. if the user clicks check 0 I have to validate only the first object and if any form data value missing I…
its me
  • 524
  • 6
  • 28
  • 62
1
2 3
11 12