2016-12-07 5 views
0

とC#の関数に渡す:HTML入力からファイルを取得し、私はこのような何かをしたい角度

//have the choose a pdf document from their local drive 
    <html> 
     <input type="file" ng-model="theInputFile"/> 
     <button ng-click="submit()"> Submit </button> 
    </html> 

    //pass the document to a c# function for parsing 
    <script> 
     $scope.submit = function(){ 
      $http.post('Home/GetVendorInfo', 
       { "c#Input": $scope.theInputFile}) 
      .success(function (response) { 
       console.log("send successtul"); 
    }); 
    </script> 

答えて

0

あなたは、コントローラとモジュールを持っている必要があり、

var app = angular.module("app", []); 
app.controller("uploadController", ["$scope", 
    function($scope) {  
$scope.submit = function(){ 
      $http.post('Home/GetVendorInfo', 
       { "c#Input": $scope.theInputFile}) 
    .success(function (response) { 
    console.log("send succestul"); 
} 
} 
関連する問題