Angular: Empty Fiddle

http://angularjs.org/

HTML

<script src="http://code.angularjs.org/angular-1.0.0rc8.js"></script>
<form name="myForm" ng-controller="MyCtrl">
    <input type="file" ng-model="filename" required onchange="MyCtrl.prototype.setFile(this)">
    {{theFile.name}}
        {{myForm.$valid}}
</form>

JavaScript

var myApp = angular.module('myApp',[]);

function MyCtrl($scope, $window) {
    $scope.name = 'Superhero';
    MyCtrl.prototype.$scope = $scope;
}

MyCtrl.prototype.setFile = function(element) {
    var $scope = this.$scope;
    $scope.$apply(function() {
        $scope.filename = element.files[0];
    });
};