【问题标题】:How to obtain server response from AngularJS controller - flow.js如何从 AngularJS 控制器获取服务器响应 - flow.js
【发布时间】:2014-11-08 08:03:50
【问题描述】:

我正在调用 API 并使用 flow.js 将图像发布到服务器。 我正在从 AngularJS 控制器进行此调用:

    <div flow-init flow-file-added="!!{png:1,gif:1,jpg:1,jpeg:1}[$file.getExtension()]">
         <button ng-click="sender($flow)">send Image</button>
    </div>


    $scope.sendImage=function(flow)
    {
        flow.upload();

    }

图片被服务器成功接收,但是我在网上搜索了如何在sendImage函数中获取服务器响应 但我找不到任何关于它的信息。

【问题讨论】:

    标签: angularjs flow-js


    【解决方案1】:

    可能为时已晚,但我就是这样做的......

    <div flow-init 
         flow-file-added="!!{png:1,gif:1,jpg:1,jpeg:1}[$file.getExtension()]" 
         flow-file-success="success($file, $message)">
        <button ng-click="sender($flow)">send Image</button>
    </div>
    
    
    $scope.success = function($file, $message) {
        $file.msg = $message;
        console.log('resp', $message);
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多