我正在努力实现 jquery 文件上传插件的 AngularJS 代码,发现:http://blueimp.github.io/jQuery-File-Upload/在 $dialog 框中使用 $dialog bootstrap 指令发现: http://angular-ui.github.io/bootstrap/#/dialog
一切都按预期工作,模态正常,文件上传正常,等等...问题是,当模态关闭时,会出现 3 个错误,然后每当打开或关闭模态时,它们都会继续在控制台上显示。他们是:
cannot call methods on fileupload prior to initialization; attempted to call method 'processing'
cannot call methods on fileupload prior to initialization; attempted to call method 'active'
cannot call methods on fileupload prior to initialization; attempted to call method 'progress'
我可以看到错误可能发生在哪里,但我只是不确定为什么或如何解决这些问题。谢谢!
这是包含相关问题的 plnkr。 http://plnkr.co/edit/vQUpJGBPGNNKsU91qIG3
最佳答案
您应该在 user-photo-tpl 中使用
.但为了让它工作,你应该将你的 Angular 升级到最新版本。这个 ng-attr-* 允许在解析后将属性添加到 DOM 元素。ng-attr-data-fileupload="options"
而不是 data-fileupload="options"
。 html
关于javascript - $Dialog 服务框中的 AngularJS jQuery 文件上传插件错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16611140/