尽管有人建议,Angular仍未对ie8开展工作

时间:2014-08-27 08:43:17

标签: angularjs internet-explorer

我正在尝试创建一个可用于ie8的angularjs应用程序。

根据这个页面:https://docs.angularjs.org/guide/ie它应该与我使用的角度1.2一起使用。

我的index.html是:

<!doctyme html>
<html ng-app="app" id="ng-app" >
<head>
    <script src="./angular.js">
    </script>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular-resource.min.js">
</script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular-route.min.js"></script>
    <script src="./custom.js">
    </script>

</head>
<body>
    <div ng-controller="statsController">
    <label>Nom:</label>
    <input type="text" ng-model="yourName" placeholder="Enter your name">
    <hr>
    <h1>Hello {{yourName}}</h1>

        <div>
    <label>Seance:</label>
    <input type="text" ng-model="yourSession" placeholder="Entersession name">
    <hr>
    <h1>Vous voulez des stats pour {{ yourSession }}</h1>
    </div>

    <table>
    <tr ng-repeat="seance in seances | filter:yourSession">
    <td> {{seance.title}} </td>
    <td> {{seance.stats }}</td>
    </tr>
    </table> 
</div>
</body>
</html>

我的js代码是

var app = angular.module('app', []);
app.controller('statsController', function($scope){
    $scope.seances = [
        {"id":1 , "title":"seance1 ,multi-acces", "stats":150},
        {"id":2 , "title":"seance 2  ,etre administrateur", "stats":550},
        {"id":3 , "title":"seance3, comment gérer sa vie", "stats":10},
        {"id":4 , "title":"derniere seance , comment réussir son breakfast", "stats":15150}
        ];
    $scope.yourName = "lzlz";
        });

问题是我的浏览器没有插入{{yourName}}并按原样显示。

有人知道它为什么不起作用吗?

由于

2 个答案:

答案 0 :(得分:1)

从评论转到答案:

你在doctype(doctyme)中输错了

答案 1 :(得分:0)

李威利是对的(在我的问题的评论中),

我的拼写错误(Doctyme而不是doctype)是问题的根源(即使它适用于Firefox)。

现在纠正了,它有效,我感到很惭愧。

它甚至似乎适用于角度1.3

感谢Lee Willis的帮助