Wkhtmltopdf带angularjs的修补QT问题

Wkhtmltopdf带angularjs的修补QT问题,angularjs,wkhtmltopdf,Angularjs,Wkhtmltopdf,我在运行带有修补Qt的任何版本的wkhtmltopdf时遇到此JavaScript错误: Warning: undefined:0 Error: [$injector:modulerr] Failed to instantiate module ng due to: 'undefined' is not an object http://errors.angularjs.org/1.5.7/$injector/modulerrp0=ng&p1='undefined'%20is%20not

我在运行带有修补Qt的任何版本的wkhtmltopdf时遇到此JavaScript错误:

Warning: undefined:0 Error: [$injector:modulerr] Failed to instantiate module ng due to:
'undefined' is not an object
http://errors.angularjs.org/1.5.7/$injector/modulerrp0=ng&p1='undefined'%20is%20not%20an%20object
(我正在尝试使用angularjs 1.5呈现页面)

当我使用一个版本的wkhtmltopdf而没有修补Qt时,我不会出现错误,而且一切正常

我使用的是安装带有补丁Qt的0.12.3版,我遇到了这个错误


你知道怎么解决我的问题吗?我可能会在生产环境中安装wkhtmltopdf而不安装修补过的Qt,但似乎我必须对其进行编译…

我最终设法使其适用于所有版本:我需要一个特殊版本的.bind()JavaScript函数polyfill:

var isFunction = function (o) {
return typeof o == 'function';
};

var bind,
slice = [].slice,
proto = Function.prototype,
featureMap;

featureMap = {
'function-bind': 'bind'
};

function has(feature) {
  var prop = featureMap[feature];
  return isFunction(proto[prop]);
}

// check for missing features
if (!has('function-bind')) {
  // adapted from Mozilla Developer Network example at
  // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/bind
  bind = function bind(obj) {
    var args = slice.call(arguments, 1),
      self = this,
      nop = function() {
      },
      bound = function() {
        return self.apply(this instanceof nop ? this : (obj || {}), args.concat(slice.call(arguments)));
      };
    nop.prototype = this.prototype || {}; // Firefox cries sometimes if prototype is undefined
    bound.prototype = new nop();
    return bound;
  };
  proto.bind = bind;
}

我也面临同样的问题,我应该把这个放在哪里?你把我发布的polyfill放在你的HTML中了吗?我需要在哪里添加这个代码?我在aspx页面脚本标记上复制了这一点,但仍然会发现模型绑定不起作用,并出现相同的错误。我正在为AngularJS使用Angel引导主题。我应该做什么更改?将其放在主/根html文件(index.html)中