Skip to content Skip to sidebar Skip to footer

Ng-message Is Not Showing

I am new to AngularJS. I am trying to validate my form using ng-pattern. I want only numbers in my field and when user types any characters or special characters, i want it to thro

Solution 1:

Your inputs are inside ng-form directive, therefore validations erros related to that input(or any inputs inside that ng-form directive), can bee accessed through that ng-form.

So, simply change your ng-messages to be:

<div ng-messages="step1form.name1.$error">
     <div ng-message="pattern">This field is invalid</div>
</div>

Working Demo


Solution 2:

ng-message is not supported in AngularJS 1.2.x .

It was introduced in AngularJS 1.3 .


Post a Comment for "Ng-message Is Not Showing"