Skip to content

Instantly share code, notes, and snippets.

@vojtajina
Created February 5, 2012 09:36
Show Gist options
  • Save vojtajina/1744412 to your computer and use it in GitHub Desktop.
Save vojtajina/1744412 to your computer and use it in GitHub Desktop.
Angular: IE8 memory leak test case
<!doctype html>
<html>
<head>
<title>angular-zrm</title>
<script src="http://ci.angularjs.org/job/angular.js-vojta/167/artifact/build/pkg/0.10.7-3173d860/angular-0.10.7-3173d860.min.js"></script>
<script src="foo-controller.js"></script>
</head>
<body ng:app>
<div ng:controller="FooController">
<button ng:click="clear()">Clear</button>
<button onclick="$('#content').remove()">Clear table</button>
<table id="content" style="border:1px solid">
<thead>
<tr>
<th>Name</th>
<th>Gender</th>
<th>Description</th>
<th>Birthday</th>
<th>Engagement</th>
<th>Last Name</th>
</tr>
</thead>
<tbody>
<tr class="row" ng:repeat="p in persons2">
<td>{{p.Name}}</td>
<td>{{p.Gender}}</td>
<td>{{p.Description}}</td>
<td>{{p.Birthday}}</td>
<td>{{p.Engagement}}</td>
<td>{{p.LastName}}</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
function FooController($scope) {
var MAX = 5000;
$scope.persons2 = [];
$scope.clear = function(){
$scope.persons2 = [];
}
for (var i = 1; i < MAX; i++) {
$scope.persons2.push({
Name:"Zhang Ruimin" ,
Gender:"Male",
Description:"Good Man",
Birthday:"1988.08.25",
Engagement:"ThoughtWorks",
LastName:"Zhang"
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment