如何基于角度6在给定的JHipster Web应用程序中使用angular-file-md5计算文件的哈希值?

时间:2018-09-07 14:42:45

标签: angular jhipster

我尝试使用angular-file-md5库,但是我仍然无法遵循其自述文件,可能是由于我不是angular方面的专家。 我创建了一个小型github项目,在该项目中,我基于jhipster框架(角度6)生成了一个基本的Web应用。

https://github.com/flefevre/jhipsterangularjsmd5/tree/master/src/main/webapp/app/entities/filehash

但是我不必在其中添加自述代码

angular.module('yourApp')
.controller('yourController', ['fileMd5Service', function(fileMd5Service) {
    this.hashFile = function(file) {
        fileMd5Service.md5(file)
        .progress(function(stats) {
            console.log('Hashed ' + stats.loaded + ' B out of ' + stats.total + ' B');
        })
        .error(function(error) {
            console.log('Error calculating md5: %o', error);
        }).success(function(md5sum) {
            console.log('MD5 for ' + file.name + ' is ' + md5sum);
        });
    };
}]);

在哪个文件

  • filehash-update.component.html 3分钟前添加基本实体文件
  • filehash-update.component.ts在3分钟前添加基本实体文件
  • filehash.component.html 3分钟前添加基本实体文件
  • filehash.component.ts在3分钟前添加基本实体文件
  • filehash.module.ts在3分钟前添加基本实体文件
  • filehash.route.ts在3分钟前添加基本实体文件
  • filehash.service.ts在3分钟前添加基本实体文件
  • index.ts添加基本实体文件

您有什么建议吗? 谢谢

0 个答案:

没有答案