Angular UI-Router无法解析Internet Explorer 9

Aar*_*sen 8 internet-explorer-9 angularjs angular-ui-router

我有一个Angular v1.3应用程序,它使用Angular ui-router v0.2.13进行所有路由.该网站适用于所有浏览器,包括IE 10和IE 11,但不适用于IE 9(我们决定不追求IE8,我理解不支持v1.3,无论如何).尽管我付出了最大的努力,IE 9仍然不断解决我的$stateProvider's otherwise路线(设置为/*path可能的罪魁祸首,因此我禁用了该路线以进行测试).

为了尝试解决任何其他路线,我尝试设置$locationProvider.html5Mode(false),修改$locationProvider.hashPrefix,更改<base href="/" />为各种URL,包括<base href="/#!"/>,我甚至包括xmlns:ng="http://angularjs.org"<html>标签中以获得良好的衡量标准.无论我尝试什么,IE 9都会不断尝试解析我的otherwise路线,如果该路线被禁用,则不会尝试.顺便说一句,我的主页路由URL设置为/.

我已经在代码中注意了我的眼球,发布截止日期迫在眉睫,所以我会第一个承认我可能会忽略一些显而易见的事情.任何人都可以提供任何其他提示或技巧,以使ui-router在IE 9中正确解析?

mal*_*lix 0

我们使用类似下面的东西:

<!DOCTYPE html>
  <html lang="fr" xmlns="http://www.w3.org/1999/xhtml" ng-csp xml:lang="fr-CA">

//...
var app = angular.module('YourApp', [...]);
angular.bootstrap(document, ['YourApp'], {strictDi: true})

//...
    angular.module('YourApp').config(['$stateProvider', '$urlRouterProvider', '$locationProvider',
  function ($stateProvider, $urlRouterProvider, $locationProvider) {
    $locationProvider.html5Mode(false);
    $locationProvider.hashPrefix('!');

    $urlRouterProvider.otherwise('/');

    $stateProvider
      .state('home', {
        url: '/',
        cache: false,
        controller: 'HomeController as vm'
      })
      .state('anon', {
        url: '/info',
        controller: 'AnonController as vm'
      })
Run Code Online (Sandbox Code Playgroud)

//ETC...