Muhammad Aamir
Muhammad Aamir

Reputation: 106

Make ui-select as required field

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

Upvotes: 0

Views: 1015

Answers (1)

Rostyslav
Rostyslav

Reputation: 47

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

Upvotes: 0

Related Questions