Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app="app">
<head >
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.0.1/angular.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body ng-controller="Main">
  <input ng-model="newItem"/>
  <label>{{newItem}}</label>
  <br/>
  <span style="padding:2px" ng-repeat="knife in knives">{{knife}}</span>
  <br/>
  <span style="padding:2px" ng-repeat="fork in forks">{{fork}}</span>
</body>
</html>
  
 
var app = angular.module('app',[]);
function Main($scope){
  console.log("initialize controller Main");
  $scope.value="a";
  $scope.$watch("newItem",function(newValue){
    $scope.knives=["a","b","c", newValue];
    $scope.forks=["d","e","f", newValue];
  });
}
Output

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

Dismiss x
public
Bin info
mrcoderpro
0viewers