我开发了一个针对 WP8.1、Android 和 iOS 的应用程序。在为 Android 开发时,它一帆风顺。我可以加载 adalJS 库并使其工作,包括对 AAD 进行身份验证和授权。该应用程序使用 Ionic、AdalJS 和 AngularJS。
当我在 VS2015 CTP 模拟器上运行适用于 Windows phone 8.1 的应用程序时,它会运行,直到我引用(在项目中本地下载的)adalJS 文件。由于 VS2015 对 WP 模拟器的调试支持不存在,所以我没有错误。但我发现,当我注释掉 adaljs 的 javascript 以及 app.module 和 app.config 中的注入时,它会加载页面并正常工作。
<head>
index.html 的:
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<script src="scripts/platformOverrides.js"></script>
<!-- ionic/angularjs js -->
<script src="assets/lib/ionic/js/ionic.bundle.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<script src="assets/lib/adaljs/adal-angular.js"></script>
<script src="assets/lib/adaljs/adal.js"></script>
<!-- your app's js -->
<script src="app/app.module.js"></script>
<script src="app/app.route.js"></script>
app.route.js
angular.module('App')
.config(['$compileProvider', '$stateProvider', '$urlRouterProvider', '$httpProvider', 'adalAuthenticationServiceProvider',
function ($compileProvider, $stateProvider, $urlRouterProvider, $httpProvider, adalProvider) { //logic here}]);
app.module.js:
angular.module('App', ['ionic','AdalAngular'])
.run(function ($ionicPlatform) {
$ionicPlatform.ready(function () {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if (window.StatusBar) {
// org.apache.cordova.statusbar required
StatusBar.styleDefault();
}
});
});
因此,当我启动应用程序并运行时,我通过删除对 adal 库的引用并注释掉 index.html 中的 adaljs 脚本引用来调试它。
我尝试搜索此错误并发现:
Mike Jone 的 windows phone 上的 cordova
的博客文章 Villa Rantala 的博客文章
Old phonegap bug which issolved
有什么建议么?