AngularJS – extra blank option added using ng-repeat in select tag

Any time you see <option value="?" selected="selected"></option> in the select, it means that your ng-model is set to a value that isn’t in the ng-options. So, if you don’t want the blank option, you need to make sure item is set to a value in your itemlist. This could be as easy as having the following in your controller:

$scope.item = $scope.itemlist[0];

This will give it an inital value, and then angular will update it for you thereafter.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)