html - Angular 1.4:进度条无法正常工作
问题描述
所以我有一个主应用程序,我们从中选择一些数据,然后将数据传递到处理microservice
数据RabbitMQ
的地方。现在我Pusher
用来发回处理的项目数量。它工作正常,但是当我将该数据传递给 时progress bar
,它无法正常工作,例如在计数为 40 之后停止显示条形图。这是我的操作方式:
var channel = pusher.subscribe('my-channel');
channel.bind('my-event', function (data) {
if (data.message === 'Added') {
$scope.totalProcessed++;
$scope.processedPercentage = ($scope.totalProcessed / $scope.totalTOsSelectedForCo2Calculations * 100).toFixed(2);
$scope.showPercentage = $scope.totalProcessed === $scope.totalTOsSelectedForCo2Calculations ? false : true;
}
});
这是我的进度条html:
<div class="progress">
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar"
aria-valuenow="{{processedPercentage}}" aria-valuemin="0" aria-valuemax="100" style="width: {{ processedPercentage}}%">
{{processedPercentage}}
</div>
</div>
这是当变量$scope.totalTOsSelectedForCo2Calculations
值为 203 时它在 14.78% 处停止的图像。我在这里做错了什么?我怎样才能让它工作?
解决方案
推荐阅读
- python - 试图调整、居中和调整秒表的输出
- python - TypeError:“模块”对象不可调用 Flask JWT
- url - 我如何与邮递员通话?
- spring - 是否有验证器来验证整数列表?私人名单
地位; - node.js - Knex、Postgres 和 STRING_ARRAY:得到不同的结果
- ios - 如何向 Cordova IOS 应用程序添加缺少的推荐人标头
- reactjs - 单击按钮不起作用 - React
- django - 检查我的 MongoDB 并得到一个不寻常的 dbs
- c# - 对 WCF WebService 的调用在本地工作,但不能从 Azure 应用服务
- sas - SAS中的虚拟变量数值差