更新到Angular 1.5.8后的.bind TypeErrors

时间:2016-07-28 21:28:10

标签: javascript jquery angularjs

我将项目从Angular 1.3.5更新为1.5.8,现在我在具有data-ui-mask="...."的视图元素上遇到错误。我在为处理滚动功能而创建的服务中也遇到了.bind错误。

我确实升级了bower.json中的所有依赖项,以确保所有内容都是最新的。

以下是错误消息之一:

TypeError: r.bind is not a function
at Object.<anonymous> (https://localhost:3000/assets/vendor-0.0.7.min.js:32:10980)
at https://localhost:3000/assets/vendor-0.0.7.min.js:6:810
at me (https://localhost:3000/assets/vendor-0.0.7.min.js:7:1828)
at f (https://localhost:3000/assets/vendor-0.0.7.min.js:6:26481)
at a (https://localhost:3000/assets/vendor-0.0.7.min.js:6:22545)
at a (https://localhost:3000/assets/vendor-0.0.7.min.js:6:22562)
at a (https://localhost:3000/assets/vendor-0.0.7.min.js:6:22562)
at a (https://localhost:3000/assets/vendor-0.0.7.min.js:6:22562)
at f (https://localhost:3000/assets/vendor-0.0.7.min.js:6:26425)
at a (https://localhost:3000/assets/vendor-0.0.7.min.js:6:22545) <input type="text" class="form-control ng-pristine ng-untouched ng-valid" id="AGENT_SSN" data-ng-model="agentModel.query.advanced.AGENT_SSN" data-ui-mask="999-99-9999">

以下是导致其中一个错误的代码示例:(注意:我使用data-ui-mask=""大约有5个这样的元素,并且所有这些元素都会抛出错误)

<input type="text" class="form-control" id="AGENT_SSN" data-ng-model="agentModel.query.advanced.AGENT_SSN" data-ui-mask="999-99-9999">

这是ScrollService,它也抛出.bind TypeError:

agency.factory('ScrollService', [function() {
    var module = angular.element(document.getElementById('scrollable-div'));
    var scroll = function(elementId) {
        var scrollTo = angular.element(document.getElementById(elementId));
        module.scrollToElement(scrollTo, 40, 500);
    };
    return scroll;
}]);

这个项目与Angular 1.3.5一起工作,我没有改变代码。正在注入所有依赖项。我猜这是一个jQuery问题,但我无法证实。

*更新*

在我的gulpfile.js中,我指出了非缩小的jquery,所有的错误都消失了。我想使用缩小文件,所以现在我将研究为什么会发生这种情况。这是jQuery的错误吗?

0 个答案:

没有答案