MobileFirst v8 和 bootstrap Angular JS v1.5.3 错误 [英] MobileFirst v8 and bootstrap Angular JS v1.5.3 error

查看:19
本文介绍了MobileFirst v8 和 bootstrap Angular JS v1.5.3 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Cordova 应用程序,它使用 MobileFirst Platform 版本 8、Ionic 版本 1.3.1 和 AngularJS 版本 1.5.3.当我运行它并引导 Angular JS 以便应用程序首先连接到 MobileFirst 平台时,我收到以下错误:

I have a Cordova application that uses MobileFirst Platform version 8, Ionic version 1.3.1 and AngularJS version 1.5.3. When I run it and bootstrap Angular JS so that the app connects to the MobileFirst Platform first I get the following error:

Error in Success callbackId: WLAuthorizationManagerPlugin561212842 : Error: [$injector:modulerr] Failed to instantiate module ng due to:
TypeError: Cannot set property 'aHrefSanitizationWhitelist' of null
    at $$SanitizeUriProvider (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:30845:35)
    at new <anonymous> (file:///android_asset/www/plugins/cordova-plugin-mfp/worklight/worklight.js:1079:23)
    at Object.instantiate (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:18010:14)
    at provider (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:17824:36)
    at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:13735:32
    at forEach (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:13705:20)
    at Object.provider (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:17814:9)
    at ngModule (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:15863:16)
    at Object.invoke (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:17995:19)
    at runInvokeQueue (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:17888:35)
http://errors.angularjs.org/1.5.3/$injector/modulerr?p0=ng&p1=TypeError%3A%…2F%2Fandroid_asset%2Fwww%2Flib%2Fionic%2Fjs%2Fionic.bundle.js%3A17888%3A35)

有人可以帮我解决这个问题吗?

Can someone help me fix this?

我发现以前有人问过类似的问题,但那是针对 MobileFirst Platform 版本 7 的,似乎没有解决.

I have found a similar question has been asked before, but that was for MobileFirst Platform version 7 and doesn't seem to be solved.

感谢您的帮助!

推荐答案

新版本 cordova-plugin-mfp 将在几天内发布,上面的问题将得到解决.

A new version of cordova-plugin-mfp will be released in couple of days where the above issue will be addressed.

同时,您可以使用以下解决方法来解决问题.

Meanwhile you can use the following workaround to resolve the issue.

  1. 将 worklight.js 中的以下代码替换为您可以在以下路径中针对不同环境找到的代码.

Android - Project/plugins/cordova-plugin-mfp/src/android/assets/www/worklight/worklight.js

Android - Project/plugins/cordova-plugin-mfp/src/android/assets/www/worklight/worklight.js

iOS - Project/plugins/cordova-plugin-mfp/src/ios/www/worklight/worklight.js

iOS - Project/plugins/cordova-plugin-mfp/src/ios/www/worklight/worklight.js

Windows - Project/plugins/cordova-plugin-mfp/src/windows/www/worklight/worklight.js

Windows - Project/plugins/cordova-plugin-mfp/src/windows/www/worklight/worklight.js

function bind(context) {
if (arguments.length < 2 && WLJSX.Object.isUndefined(arguments[0])) {
return this;
}
var __method = this,
args = slice.call(arguments, 1);
return function() {
var a = merge(args, arguments);
return __method.apply(context, a);
};
}

应该替换为

function bind(obj) {
var args = Array.prototype.slice.call(arguments, 1),
self = this,
Nop = function() {
},
bound = function() {
return self.apply(
this instanceof Nop ? this : (obj || {}), args.concat(
Array.prototype.slice.call(arguments)
)
);
};
Nop.prototype = this.prototype || {};
bound.prototype = new Nop();
return bound;
}

  1. 移除平台并重新添加平台.

这篇关于MobileFirst v8 和 bootstrap Angular JS v1.5.3 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆