文档不是用 jshint 定义的
document is not defined with jshint
在此代码中:
$scope.others=[some data...]
$scope.tab=[];
$scope.smt = function(x){
for(var i = 0; i < $scope.others; i++){
var el = angular.element(document.querySelector('#'+x));
if (el.hasClass("myClass")){
sel.push($scope.tab[i]);
}
}
}
JSHint 抱怨:
'document' is not defined
将 "browser" : true
添加到您的 jshint 配置或在文件顶部添加 /* jshint browser: true */
以让 jshint 知道您的环境是浏览器。参见 documentation
在此代码中:
$scope.others=[some data...]
$scope.tab=[];
$scope.smt = function(x){
for(var i = 0; i < $scope.others; i++){
var el = angular.element(document.querySelector('#'+x));
if (el.hasClass("myClass")){
sel.push($scope.tab[i]);
}
}
}
JSHint 抱怨:
'document' is not defined
将 "browser" : true
添加到您的 jshint 配置或在文件顶部添加 /* jshint browser: true */
以让 jshint 知道您的环境是浏览器。参见 documentation