Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body ng-app="app">
  <div ng-controller="AppCtrl as ctrl">
    <select 
      ng-change="ctrl.selectAction()"
      ng-model="ctrl.myOption"
      ng-options="value.id as value.label for value in ctrl.myOptions">
      <option>--</option>
    </select>
  </div>
  
</body>
</html>
 
var app = angular.module("app", []);
app.controller("AppCtrl", function () {
  this.myOptions = [
        {
            "id": 101,
            "label": "Item 1"
        },
        {
            "id": 102,
            "label": "Item 2"
        }
  ];
  this.myOption = this.myOptions[0];
  this.selectAction = function() {
    console.log(this.myOption);
};
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers