Trying to use the latest version (1.5.8) of AngularJS and ng-options to populate a dropdownlist.
Issue is that it's adding the data type as well as the value, like so:
<select class="possedetail ng-valid ng-dirty ng-valid-parse ng-touched" ng-model="Province" ng-options="p as p for p in provList">
<option value="string:ALBERTA" label="ALBERTA">ALBERTA</option>
<option value="string:BRITISH COLUMBIA" label="BRITISH COLUMBIA">BRITISH COLUMBIA</option></select>
I need string:Alberta'...
This is my data source:
$scope.provList = ["ALBERTA","BRITISH COLUMBIA","MANITOBA","NEW BRUNSWICK","NEWFOUNDLAND AND LABRADOR","NORTHWEST TERRITORIES","NOVA SCOTIA","NUNAVUT","ONTARIO","PRINCE EDWARD ISLAND","QUEBEC","SASKATCHEWAN","YUKON",];
I have read the google documentation, searched the web and tried changing my data source format to [{name: "Alberta"}, {name:"BC"}]...
Please help, any way around this?
value
attribute of generated options? Don't. You shouldn't care about that. The only thing you ought to care about is the model value - i.e.$scope.Province
– Likker