0

How do I set the ng-options default value...

here is my ng-option directive:

ng-options="val as val for val in ticket_group.splits"
Noah
  • 15
  • 1
  • 6

1 Answers1

0

use ng-init

<select ng-init="myModel = ticket_group.splits[0]" ng-model="myModel" ng-options="val as val for val in ticket_group.splits"></select>

or set the myModel value inside the controller,

$scope.myModel = ticket_group.splits[0]; // ticket_group.splits[1]; ticket_group.splits[2]; .. or what u need

demo

Kalhan.Toress
  • 21,683
  • 8
  • 68
  • 92