使用Angular和Magento(与prototype.js冲突?)

时间:2016-07-27 19:23:53

标签: angularjs magento prototypejs

我需要在Magento产品页面上使用Angular.js但是我很快就被卡住了,只要我声明我的应用程序,它就会生成此错误:

TypeError: Cannot set property 'aHrefSanitizationWhitelist' of null
at $$SanitizeUriProvider (http://localhost/js/angular/angular.js:18134:35)
at new <anonymous> (http://localhost/js/prototype/prototype.js:391:23)
at Object.instantiate (http://localhost/js/angular/angular.js:4733:14)
at provider (http://localhost/js/angular/angular.js:4547:36)
at http://localhost/js/angular/angular.js:365:32
at forEach (http://localhost/js/angular/angular.js:335:20)
at Object.provider (http://localhost/js/angular/angular.js:4537:9)
at ngModule (http://localhost/js/angular/angular.js:2569:16)
at Object.invoke (http://localhost/js/angular/angular.js:4718:19)
at runInvokeQueue (http://localhost/js/angular/angular.js:4611:35)

我显然怀疑prototype.js和angular之间存在冲突但到目前为止找不到任何解决方案。

按以下顺序加载不同的JS文件: 1 / jQuery 2 /原型 3 / Angular

有人有任何暗示吗?或者根本不可能实现? 谢谢!

编辑:所以如果有人感兴趣: - Magento 1.9.2.4(因此prototype.js 1.7)与Angular 1.5.8不相符 - 我使用了Angular 1.4.3并且工作正常 - 那我就到了 使用Angular 1.4而不是1.5时,我有什么重要意义?

1 个答案:

答案 0 :(得分:0)

尝试使用单向绑定时遇到了同样的问题(包含在Angular 1.5中)https://docs.angularjs.org/api/ng/service/ $ compile#-scope -

我找到的唯一解决方案是使用Angular 1.4。