{{theFile.name}}
<!doctype html>
<html> <head> </head><!-- infovision--> <body ng-app="myApp"> <div ng-controller="MyCtrl"> <input type="file" onchange="angular.element(this).scope().setFile(this)"> {{theFile.name}} </div> <script type='text/javascript'> var myApp = angular.module('myApp', []); myApp.controller('MyCtrl', function($scope) { $scope.setFile = function(element) { $scope.$apply(function($scope) { $scope.theFile = element.files[0]; }); }; }); </script> </body> </html> |