Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app="stackApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body ng-controller="StackController as vm">
  <table>
  <tr ng-repeat="company in vm.companies">
   <td><input data-ng-model="company.
     name"/></td>
   <td>
     <select data-ng-model="company.responsible" data-ng-options=" seller.id as seller.login for seller in vm.sellers">
     </select>
   </td>
</tr>
  </table>
  
  <h2>Json vm.companies</h2>
  <pre>{{vm.companies | json}}</pre>
  
</body>
</html>
 
var StackController = function() {
  this.companies = [
    {
      name: 'company 1',
      responsible : 1
    },
     {
      name: 'company 2',
      responsible : 2
    },
     {
      name: 'company 3',
    }
  ];
  
  this.sellers = [
    {
      login : 'pavel',
      id : 1,
    },
    {
      login : 'petr',
      id : 2,
    },
    {
      login : 'igor',
      id : 3,
    }
  ];
};
angular.module('stackApp', [])
  .controller('StackController', StackController);
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers