AngularJS控制器代码未在IE9中进行评估

Mat*_*att 2 internet-explorer-9 angularjs

谢谢你的期待.

我有一些AngularJS代码在IE9的所有浏览器中运行良好.IE8甚至可以正常工作,但不是IE9.

例如,以下屏幕抓取中的断点将不会在IE9中被命中,尽管它上面的一些常规JS代码被命中:

在此输入图像描述

再次,这在IE8中甚至可以正常工作.Odder仍然没有产生JavaScript错误.有任何想法吗?

Mat*_*att 5

万一其他人遇到这个令人沮丧的问题,对我来说答案是这样的:

body像这样创建你的开场标签:

<body xmlns:ng="http://angularjs.org" id="ng-app">
Run Code Online (Sandbox Code Playgroud)

然后,在结束body标记之前,放置以下内容script:

 <script>
         (function () {

                 angular.module('app');

                 angular.element(document).ready(function () {
                     angular.bootstrap(document, ['app']);
                 });                

         })();
        </script>
Run Code Online (Sandbox Code Playgroud)

我有关于它为何起作用的理论,但事实上我并不确定.希望它可以帮助别人.