<分区>
当我尝试在 sublime text 中保存以下代码时,
'use strict';
/*global angular,_*/
var app = angular.module("myApp", []);
app.controller("myCtrl", function ($scope) {
$scope.firstName = "John";
$scope.lastName = "Doe";
});
我收到以下 jslint 错误:
#1 Unexpected expression 'use strict' in statement position.
'use strict'; // Line 1, Pos 1
#2 Place the '/*global*/' directive before the first statement.
/*global angular,_*/ // Line 2, Pos 1
#3 Undeclared 'angular'.
var app = angular.module("myApp", []); // Line 4, Pos 11
#4 Expected 'use strict' before '$scope'.
$scope.firstName = "John"; // Line 6, Pos 3
#5 Expected '$scope' at column 5, not column 3.
$scope.lastName = "Doe"; // Line 7, Pos 3