0
我有qz-tray.js離子,它工作,但成功打印後,應用程序崩潰時,我想導航到其他頁面,這裏是日誌qz-tray 2.0打印離子/ angularjs成功打印後崩潰
ionic.bundle.min.js:142 TypeError: Cannot read property 'params' of undefined
at i (ionic.bundle.min.js:423)
at Object.x.transitionTo (ionic.bundle.min.js:423)
at Array.<anonymous> (ionic.bundle.min.js:423)
at Object.e [as invoke] (ionic.bundle.min.js:73)
at g (ionic.bundle.min.js:423)
at ionic.bundle.min.js:423
at b (ionic.bundle.min.js:423)
at m (ionic.bundle.min.js:423)
at n.$broadcast (ionic.bundle.min.js:171)
at l (ionic.bundle.min.js:138)
我只是把qz-tray.js
爲depedency,然後控制器
qz.websocket.connect().then(function() {
return qz.printers.find('MobilePrinter');
}).then(function (printer) {
var config = qz.configs.create(printer);
var data = [respon.data];
return qz.print(config, data).then(function() {
qz.websocket.disconnect();
});
})
它確實打印數據上,但該應用程序崩潰後,任何幫助,將不勝感激,謝謝。
[解決]
此功能影響陣列迭代(在)中,i評論原型解決了這個問題(qz-tray.js
線500)
stringify: function(object) {
//old versions of prototype affect stringify
var pjson = Array.prototype.toJSON;
delete Array.prototype.toJSON;
var result = JSON.stringify(object);
Array.prototype.toJSON = pjson;
return result;
},
您好,感謝您在這裏的建議 – bowpunya
@bowpunya是另一種可能的解決方案:https://github.com/qzind/tray/issues/67#issuecomment-250049338 – tresf
@bowpunya我們上游增加了一個解決辦法,並應爲您解決問題:https://github.com/qzind/tray/commit/e0658fdf8aacc9423fc8e7c0505047098b58c84a – tresf