0

When ever i am trying to set the inital value in the angularJS selector, it returns a "blank" element with the value "<option value="? number:1000139 ?">

how can i achieve setting the default value, without having it set to some gibberish.

my selector looks like this:

<select ng-model="dataToCheckForImport.importContractId" ng-init="dataToCheckForImport.importContractId=opt.selectedContract">
   <option ng-selected="{{option.contract.kontraktID == dataToCheckForImport.importContractId}}" value="{{option.contract.kontraktID}}" ng-repeat="option in opt.allContracts">{{option.contract.kontraktID}} </option>
   <option value="-1">In Column</option>
 </select>

and this is the output iam getting: enter image description here

ive tried setting it as a string aswell, this only made my output have a "string format" like "<option value="? string:1000139 ?">

what am i doing wrong?

1 Answers1

0

Anyone finding this, the problem is when types do not match each other. in my example i tried to initialize my selector with a string and not a number as every other option is a number. Making all value "strings" solved my problem. also covered in this question:
Angular adds strange options into select element when setting model value