【问题标题】:ionic ng cordova TypeError: "Cannot read property 'printer' of undefined"ionic ng cordova TypeError:“无法读取未定义的属性'打印机'”
【发布时间】:2016-06-10 07:43:13
【问题描述】:

.controller('MyCtrl', function($scope,$cordovaPrinter, ) {

$scope.print = function() {
  console.log('print method here');
     var page = document.getElementById('print_id');
      if($cordovaPrinter.isAvailable()) {
          $cordovaPrinter.print(page, 'Document.html', function () {
          alert('printing finished or canceled')
          });
        }
}

请给我有关此错误的任何建议。 谢谢

【问题讨论】:

  • 描述你想做什么。
  • 我想从页面打印一些内容,但 css 没有加载元素。

标签: cordova ionic-framework


【解决方案1】:

我面临同样的错误。 我重新安装插件使用:cordova plugin rm cordova-plugin-printer 并使用再次安装:cordova plugin add https://github.com/katzer/cordova-plugin-printer.git 最后是cordova build

【讨论】:

    猜你喜欢
    • 2017-01-02
    • 2015-03-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-05
    • 1970-01-01
    • 1970-01-01
    • 2015-08-18
    相关资源
    最近更新 更多