0
Ich habe dies in meiner ‚View-Datei‘Angular ng Optionen Standardauswahlwert
<select class="form-control" id="selection" ng-model="currentSelected"
ng-options="selection.id as selection.name for selection in selections track by selection.id"></select>
Und dies in meinem Controller
$scope.currentSelected = 1;
$scope.selections = [
{
id: 1,
name: 'Name #1'
},
{
id: 2,
name: 'Name #2'
}
];
jedoch die Auswahl von Optionen sind leer und ich möchte es sein In diesem Beispiel "Name # 1". Was fehlt mir hier?
entfernen 'Spur von selection.id'. –
Vielen Dank, @JBNizet –