Angular: Empty Fiddle
http://angularjs.org/
HTML
<script src="http://code.angularjs.org/angular-1.0.1.js"></script>
<div ng-controller="MyCtrl">
Hello, {{name}}!
<input id="filechooser" type="file" multiple onchange="angular.element(this).scope().addFilesToUpload(this)" />
<table>
<tbody>
<tr ng-repeat="up in uploadList" ng-click="setSelected(up)">
<td><span ng-class="{selected: selectedUpload == up}">{{up.Name}}</span>
<br />{{up.NewFiles.length}}
</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr ng-repeat="file in selectedUpload.NewFiles">
<td>{{file.name}}</td>
</tr>
</tbody>
</table>
</div>
CSS
.selected {
color: orange;
}
JavaScript
var myApp = angular.module('myApp',[]);
function MyCtrl($scope) {
$scope.name = 'Superhero';
$scope.uploadList = [{Name: "Test Upload",
Id: 1,
NewFiles: []
}];
$scope.selectedUpload = null;
$scope.setSelected = function(upload) {
$scope.selectedUpload = upload;
}
$scope.addFilesToUpload = function(element){
$scope.$apply(function() {
$scope.selectedUpload.NewFiles = element.files;
});
}
}