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

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -