javascript - jSLint with Angular causes Unexpected '$scope' error -
i'm receiving "unexpected '$scope'" error when run jslint against angular based app building.
below reduced version of code causing error. can input code jslint.com website reproduce problem.
i don't understand why first function declaration (downloadfile) doesn't cause error second (buildfile).
/*jslint browser: true*/ /*global angular */ angular.module('testapp') .controller('filectrl', ["$scope", function ($scope) { "use strict"; $scope.downloadfile = function () { window.location = '/path/to/file'; } $scope.buildfile = function () { } }]);
lack of semicolons after function causing error
$scope.downloadfile = function () { window.location = '/path/to/file'; }; //<-- add semicolon $scope.buildfile = function () { }; //<-- add semicolon
Comments
Post a Comment