【发布时间】:2018-04-26 17:40:16
【问题描述】:
我想要做的是向我的模板添加一个进度条,该进度条将根据我的文件上传进度动态地不断更新其值。我使用了 angular-loading-bar,但我想为以下 $http 请求拥有自己的:-
$http.patch(url, fd, {
transformRequest: angular.identity,
headers: {'Content-Type': undefined}
}).then(successCallback, errorCallback);
function successCallback(response){
console.log("Success");
console.log(response);
};
function errorCallback(error){
alert("Error Uploading!");
console.log(error);
};
我想更新我的以下进度条:-
<div class="progress">
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="{{ progress }}" aria-valuemin="0" aria-valuemax="100" style="width: {{ progress }} %">
{{ progress }} %
</div>
</div>
{{ progress }} 应该是我的文件上传百分比值。提前致谢。
【问题讨论】: