Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html >
<head>
  <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body ng-app="myApp" ng-controller="AppCtrl">
  
  <div ng-repeat="item in mydata">
      <h1>{{item.name}}</h1>
    <h1>{{item.age}}</h1>
    </div>
  <div data-a='[
    {
        "name": "vic",
        "age": 100
    },
    {
        "name": "bob",
        "age": 200
    }
]'  id="mydata"></div>
</body>
</html>
 
var app = angular.module('myApp', []);
app.controller("AppCtrl", function($scope) {
  $scope.mydata = $("#mydata").data("a");
});
/*
  in the console if I change "vic" to "bill" with; 
  $("#mydata").data("a")[0].name = "bill"
 then shouldn't the view also change to reflect the changed value? 
 
*/
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers