angularjs – 在IE9中使用Angular 2需要什么?

我一直在尝试创建一个Angular 2应用程序(使用入门指南)作为模板,但虽然它在Chrome中运行得非常好,但我很难让它在IE9中运行!

基本上,应用程序在加载/运行boot / js时失败,并向开发人员控制台报告以下错误.

日志:错误:对象不支持此操作

有没有人有任何建议或建议 – 甚至更好 – 一个实际在IE9中工作的演示?

我的index.html的开头如下所示……

<head>
<title ng-bind="title">xxx</title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
<base href="/">

<link rel="stylesheet" href="/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">

<link rel="stylesheet" href="/css/style.css" />
<link rel="stylesheet" href="/css/main.css" />

</body>

<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.4.1/es5-sham.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.1/es6-sham.min.js"></script>
<script src="/app/shims_for_IE.js"></script>
<script src="https://rawgithub.com/systemjs/systemjs/0.19.6/dist/system.js"></script>
<script src="https://code.angularjs.org/tools/typescript.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.1/angular2-polyfills.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.1/Rx.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.1/angular2.dev.js"></script>

<script>
    System.config({
    packages: {        
      app: {
        format: 'register',defaultExtension: 'js'
      }
    }
  });
  System.import('app/boot')
        .then(null,function(err){
            console.log(err);
        });
</script>

随着Angular代码遵循https://angular.io/guide/quickstart到字母!

更新1:
通过更多测试(主要是在较新的IE浏览器中),我正在尝试相同的问题,但看到更多的细节..

TypeError: Object doesn't support property or method 'keys'
   at Anonymous function (http://localhost:5000/app/angular2.dev.js:783:5)
   at Anonymous function (http://localhost:5000/app/angular2.dev.js:781:3)
   at linkDynamicModule (https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.16/system.src.js:3130:5)
   at getModule (https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.16/system.src.js:3098:9)
   at Anonymous function (https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.16/system.src.js:3134:9)
   at Anonymous function (http://localhost:5000/app/angular2.dev.js:10795:3)
   at linkDynamicModule (https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.16/system.src.js:3130:5)
   at getModule (https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.16/system.src.js:3098:9)
   at Anonymous function (https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.16/system.src.js:3134:9)
   at Anonymous function (http://localhost:5000/app/angular2.dev.js:12011:3)

index.html目前看起来像……

<head>
<title ng-bind="title">xxx</title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,user-scalable=no" />
<base href="/">

<link rel="stylesheet" href="/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">

<link rel="stylesheet" href="/css/style.css" />
<link rel="stylesheet" href="/css/main.css" />

<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.4.1/es5-sham.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.1/es6-sham.min.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.1/angular2-polyfills.js"></script>

<script src="https://code.angularjs.org/tools/typescript.js"></script>

<script src="/app/reflect.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.16/system.src.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.16/system-polyfills.src.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.1/Rx.js"></script>
<!--<script src="https://code.angularjs.org/2.0.0-beta.1/angular2.dev.js"></script>-->
<script src="/app/angular2.dev.js"></script>



<script src="/app/shims_for_IE.js"></script>


<script>
    System.config({
    packages: {        
      app: {
        format: 'register',defaultExtension: 'js'
      }
    }
  });
  System.import('app/boot')
        .then(function(){
        },function(err){
            console.log(err.stack);
        });
</script>
修复Angular2 RC4 IE9:

>包含脚本:

< script src =“https://npmcdn.com/angular2@2.0.0beta.17/es6/dev/src/testing/shims_for_IE.js”>< / script>

>将路由方法更改为“#”

从’@ angular / common’导入{LocationStrategy,HashLocationStrategy};

bootstrap(AppComponent,[

{提供:LocationStrategy,useClass:HashLocationStrategy}
]);

>不要使用浏览器历史记录进行导航:

window.history.back(); //坏

相关文章

ANGULAR.JS:NG-SELECTANDNG-OPTIONSPS:其实看英文文档比看中...
AngularJS中使用Chart.js制折线图与饼图实例  Chart.js 是...
IE浏览器兼容性后续前言 继续尝试解决IE浏览器兼容性问题,...
Angular实现下拉菜单多选写这篇文章时,引用文章地址如下:h...
在AngularJS应用中集成科大讯飞语音输入功能前言 根据项目...
Angular数据更新不及时问题探讨前言 在修复控制角标正确变...