NG-电网IE8不工作 [英] ng-grid not working in IE8
问题描述
我要坚果试图找出为什么NG电网不工作的IE8。我得到这个错误:预期标识符,字符串或数字NG-网格2.0.5.debug.js,行1535字符17
我复制一个例子直接从纳克网主页(所有的例子有正确加载,顺便说一句)。任何人都有一个想法吗?
我把一个Plnkr或小提琴,但也甚至会在IE8加载,所以它种失败的目的。
使用角1.0.4,1.8.1的jQuery,NG-电网2.0.5
HTML
< HTML NG-应用=对myApp>
<头LANG =ENGT&;
<间的charset =UTF-8>
<标题>入门ngGrid例< /标题>
<链接rel =stylesheet属性类型=文/ CSS的href =NG-grid.css/>
<链接rel =stylesheet属性类型=文/ CSS的href =style.css文件/>
<脚本类型=文/ JavaScript的SRC =jQuery的-1.8.1.js>< / SCRIPT>
<脚本类型=文/ JavaScript的SRC =angular.js>< / SCRIPT>
<脚本类型=文/ JavaScript的SRC =NG-格2.0.5.js>< / SCRIPT>
<脚本类型=文/ JavaScript的SRC =main.js>< / SCRIPT>
< /头>
<机身NG控制器=MyCtrl>
< DIV CLASS =gridStyleNG格=gridOptions>< / DIV>
< /身体GT;
CSS
.gridStyle {
边框:1px的固体RGB(212212212);
宽度:400像素;
高度:300像素;
}
的JavaScript
VAR应用= angular.module('对myApp',['ngGrid']);
app.controller('MyCtrl',函数($范围){
$ scope.myData = [{名:莫罗尼,年龄:50},
{名:Tiancum,年龄:43},
{名:雅各布,年龄:27},
{名:尼,年龄:29},
{名:挪,年龄:34}];
$ scope.gridOptions = {
数据:myData的,
columnDefs:[{字段:名称,显示名:名称},{场:'年龄',显示名:'年龄'}]
};
});
原来答案就没有那么明显了。有那里的开发者都在一个地方,而不是angular.forEach使用JavaScript的forEach方法在NG-电网2.0.5的错误。这不是由IE8支持并导致错误。我提交给了该组,他们会解决它,但现在我只是做了改变。
I'm going nuts trying to figure out why ng-grid isn't working in IE8. I get this error: Expected identifier, string or number ng-grid-2.0.5.debug.js, line 1535 character 17
.
I'm copying an example straight from the ng-grid homepage (all the examples there load correctly, by the way). Anyone have an idea here?
I would put up a Plnkr or fiddle, but neither will even load in IE8, so it kind of defeats the purpose.
using Angular 1.0.4, jQuery 1.8.1, ng-grid 2.0.5
html
<html ng-app="myApp">
<head lang="en">
<meta charset="utf-8">
<title>Getting Started With ngGrid Example</title>
<link rel="stylesheet" type="text/css" href="ng-grid.css" />
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="jquery-1.8.1.js"></script>
<script type="text/javascript" src="angular.js"></script>
<script type="text/javascript" src="ng-grid-2.0.5.js"></script>
<script type="text/javascript" src="main.js"></script>
</head>
<body ng-controller="MyCtrl">
<div class="gridStyle" ng-grid="gridOptions"></div>
</body>
CSS
.gridStyle {
border: 1px solid rgb(212,212,212);
width: 400px;
height: 300px;
}
Javascript
var app = angular.module('myApp', ['ngGrid']);
app.controller('MyCtrl', function($scope) {
$scope.myData = [{name: "Moroni", age: 50},
{name: "Tiancum", age: 43},
{name: "Jacob", age: 27},
{name: "Nephi", age: 29},
{name: "Enos", age: 34}];
$scope.gridOptions = {
data: 'myData',
columnDefs: [{field:'name', displayName:'Name'}, {field:'age', displayName:'Age'}]
};
});
Turns out the answer was not so obvious. There was a bug in ng-grid 2.0.5 where the devs were using the Javascript forEach method in one spot instead of angular.forEach. This is not supported by IE8 and was causing the error. I submitted it to the group and they'll fix it, but for now I just made the change.
这篇关于NG-电网IE8不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!