Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app="app">
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body ng-controller="MainController">
<p ng-repeat="opt in objHistory.OptionItems track by $index">
  <a href="javascript:;" 
  ng-model = "userInput"
  ng-init="init(opt)" 
  ng-click="GetNextItem()">{{ opt.SortOrder }}. {{ opt.OptionName }}
  </a>
</p>
    <textarea ng-model="userInput"></textarea>
</body>
</html>
 
angular.module("app",[]).controller("MainController", function($scope) {
  
  $scope.GetNextItem = function () {
  alert($scope.userInput);
  //some code
};
  
  $scope.init = function(opt) {
    $scope.userInput = opt.SortOrder;
  };
  $scope.objHistory = {
    OptionItems: [{
      SortOrder : "1",
      OptionName: "Hi"
      
    }, {
      SortOrder : "2",
      OptionName: "Hi"
      
    }]
  }
});
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers