Sta*_*eam 5 javascript mobile blueimp typescript angular
我最近将blueimp JS gallery与我的angular 2(运行angular-cli)应用程序集成在一起.我通过NPM(npm install blueimp-gallery --save)安装它并通过.angular-cli.json以下方式导入:
"styles": [
"../node_modules/blueimp-gallery/css/blueimp-gallery.css",
"../node_modules/blueimp-gallery/css/blueimp-gallery-indicator.css"
],
"scripts": [
"../node_modules/blueimp-gallery/js/blueimp-helper.js",
"../node_modules/blueimp-gallery/js/blueimp-gallery.js",
"../node_modules/blueimp-gallery/js/blueimp-gallery-indicator.js"
]
Run Code Online (Sandbox Code Playgroud)
从那里,我在角度组件中使用它:
//from .angular-cli.json
declare const blueimp: any;
public show(event: any, images: any[]) {
const options = {
event: event || window.event,
};
blueimp.Gallery(images, options);
};
Run Code Online (Sandbox Code Playgroud)
到目前为止,这么好:它工作正常,我可以使用画廊.但是,我最近收到了移动设备客户的崩溃报告.我想打开一个github问题,但似乎在blueimp/Gallery github repo上是不可能的.
这是一个在Android设备上看到很多的崩溃:
TypeError: Cannot read property 'style' of undefined
at Gallery.translate (eval at P+fo.t.exports (/scripts.46c7e72cc98882b84ae5.bundle.js:1:18074), <anonymous>:492:37)
at Gallery.translateX (eval at P+fo.t.exports (/scripts.46c7e72cc98882b84ae5.bundle.js:1:18074), <anonymous>:501:12)
at Gallery.move (eval at P+fo.t.exports (/scripts.46c7e72cc98882b84ae5.bundle.js:1:18074), <anonymous>:487:12)
at Gallery.slide (eval at P+fo.t.exports (/scripts.46c7e72cc98882b84ae5.bundle.js:1:18074), <anonymous>:339:14)
at eval (eval at P+fo.t.exports (/scripts.46c7e72cc98882b84ae5.bundle.js:1:18074), <anonymous>:384:22)
at n.invokeTask (/polyfills.0a60947aabdcee7751c0.bundle.js:36:7074)
at Object.onInvokeTask (/vendor.7a5c4da3f678e71e26f9.bundle.js:261:2558)
at n.invokeTask (/polyfills.0a60947aabdcee7751c0.bundle.js:36:7010)
at t.runTask (/polyfills.0a60947aabdcee7751c0.bundle.js:36:4427)
at invoke (/polyfills.0a60947aabdcee7751c0.bundle.js:36:8187)
at t.args.(anonymous function) (/polyfills.0a60947aabdcee7751c0.bundle.js:15:85)
Run Code Online (Sandbox Code Playgroud)
另一个只在iOS设备上发生:
EXCEPTION: undefined is not an object (evaluating 'this.slides[index].style')
translate
translateX
move
slide
invokeTask@/polyfills.0a60947aabdcee7751c0.bundle.js:36:7079
onInvokeTask@/vendor.7a5c4da3f678e71e26f9.bundle.js:261:2568
invokeTask@/polyfills.0a60947aabdcee7751c0.bundle.js:36:7022
runTask@/polyfills.0a60947aabdcee7751c0.bundle.js:36:4437
invoke@/polyfills.0a60947aabdcee7751c0.bundle.js:36:8194
Run Code Online (Sandbox Code Playgroud)
两次崩溃都与blueimp代码相同.我似乎无法确定那些崩溃,我正在努力修复它们.
有没有人一直在使用带角2+的blueimp?有没有人见过blueimp Gallery的类似问题?
| 归档时间: |
|
| 查看次数: |
606 次 |
| 最近记录: |