material icon indicating copy to clipboard operation
material copied to clipboard

md-autocomplete does not work with ng-messages validation

Open MetalHexx opened this issue 11 years ago • 27 comments

As per issue #1780, ng-messages still fails to fire on md-autocomplete directives.

I've tried using the "name", "input-name", and "md-input-name" attribute on the md-autocomplete element and of course added a required attribute.

After trying to submit the form to save, the md-autocomplete form element does not show up as member on the $scope.form object. Oddly enough, the $scope.form.$valid == false if you check it. It just doesn't render the ng-message.

The code pen linked off the autocomplete demo site also does not work. I had to save it to share it: http://codepen.io/MetalHexx/pen/qdVBLa

MetalHexx avatar Jun 22 '15 20:06 MetalHexx

For those who still want to use the autocomplete control bundled with angular-material, You can add an input element below the autocomplete and add an ng-hide="true" to hide the control. The ng-message will still render and appear to refer to the md-autocomplete control.

MetalHexx avatar Jun 22 '15 20:06 MetalHexx

+1

caok2709 avatar Jun 22 '15 22:06 caok2709

+1

vicky-gonsalves avatar Jun 25 '15 10:06 vicky-gonsalves

Sorry guys, this was broken right before I was out for a little over a week and went entirely too long without being addressed. Fixing this now.

robertmesserle avatar Jun 26 '15 15:06 robertmesserle

Thanks for the quick turnaround, robert! When will this fix be live?

MetalHexx avatar Jun 28 '15 01:06 MetalHexx

@robertmesserle Thanks for the quick fix. Hoping to get it live soon.

vicky-gonsalves avatar Jun 29 '15 05:06 vicky-gonsalves

Hey @robertmesserle, any idea when this feature will be live?? thanks (:

prxgiusti avatar Aug 10 '15 13:08 prxgiusti

Hey @robertmesserle , when will this be live?

ryananthonydrake avatar Feb 03 '16 23:02 ryananthonydrake

Hey there, also would love to see this live. Any assumption? @robertmesserle

czery avatar Feb 18 '16 16:02 czery

+1

SelmanAY avatar Mar 08 '16 21:03 SelmanAY

+1

eniniz avatar Mar 23 '16 10:03 eniniz

+1

ringil-21 avatar Mar 23 '16 12:03 ringil-21

+1

jojogeyer avatar Mar 23 '16 12:03 jojogeyer

+1

ghost avatar Mar 23 '16 20:03 ghost

+1

shrutiaggarwal3012 avatar Apr 10 '16 15:04 shrutiaggarwal3012

Using ng-form instead of form, ng-messages with autocomplete doesn't work

piyushchauhan2011 avatar Apr 19 '16 07:04 piyushchauhan2011

Hi @piyushchauhan2011 ,

The ng-form directive is not a replacement for the form tag. In the docs they say:

The purpose of ngForm is to group controls, but not to be a replacement for the

tag with all of its capabilities (e.g. posting to the server, ...).

So use your ng-form nested into a form tag, and everything should works as expected.

ringil-21 avatar Apr 19 '16 07:04 ringil-21

This is still an issue where validations do not fire.

ryananthonydrake avatar Apr 29 '16 03:04 ryananthonydrake

The issue still presents in the actual version, I'm using version v1.0.6, but it does'nt work correctly for md-select as it doesn't shows the redline. But actual version does show it for md-select.

however is not working correctly for autocomplete

sebasecheverry avatar May 03 '16 21:05 sebasecheverry

+1

stephengardner avatar May 07 '16 07:05 stephengardner