Make ui-select as required field

977 Views Asked by At

ng-required="true" and only required tags or not working with ui-select, this is a long standing bug and I think it is not solved yet.

%ui-select(ng-model="obj.prop" required) %ui-select(ng-model="obj.prop" ng-required="true")

above lines don't work.These lines should workd like %input.form-control(ng-model="obj.prop" ng-required="true" type="text")

I want to make ui-select as required field, If this is really a bug then is there an alternate way ??

These lines let the form to be submit even nothing is selected and don't make it as required

1

There are 1 best solutions below

0
On

I had this problem, because I set the ng-model value initially to {}. When I set it to null it worked.