ng-admin
ng-admin copied to clipboard
Required validation do not work with choice field
Hi there,
So I have a simple creation view with 2 field and one of them are a choice field. I would like to apply a required validation to both field. But surprisingly it doesnt work on the choice field. I get following error in console
ReferenceError: notification is not defined
at admin?v=NvSTDGEHvKUkyCQOAsmmb6D03XHQNEo34sQmniCFOYs1:1
at tt (admin?v=NvSTDGEHvKUkyCQOAsmmb6D03XHQNEo34sQmniCFOYs1:1)
at admin?v=NvSTDGEHvKUkyCQOAsmmb6D03XHQNEo34sQmniCFOYs1:1
at w.$eval (admin?v=NvSTDGEHvKUkyCQOAsmmb6D03XHQNEo34sQmniCFOYs1:1)
at w.$digest (admin?v=NvSTDGEHvKUkyCQOAsmmb6D03XHQNEo34sQmniCFOYs1:1)
at w.$apply (admin?v=NvSTDGEHvKUkyCQOAsmmb6D03XHQNEo34sQmniCFOYs1:1)
at HTMLFormElement.
Here are my fields setup fields([ nga.field('Name') .validation({ required: true}) .label('Color Name'), nga.field('IsActive','choice') .label('Status') .validation({ required: true}) .choices([ { value: true, label: 'Active' }, { value: false, label: 'Inactive' } ]), ]);
I could live if I have a way to setup default choice so I dont need to worry about validation.
Thanks Keep It Positive
I have the same problem,
Could help with a solution to this?
Thank you
+1
I think that misses a "this" keyword before "notification", in FormController (1.0.0.alpha4, line 31). It misses only in build files, maybe the build is not in sync with the source...
thanks!
(this bug force me to install/build ng-admin on my build tasks... it would be beautiful to have a new 0.9.x release with the /build files in sync with the sources...)
thanks!
Thie error is fixed in 1.0.0-Alpha7. I.e the "ReferenceError: notification is not defined" error does not occur anymore. However one would expect to get a popup "Please fill out this field" on the required choice field, and not an "Invalid Form" global notification