Search code examples
javascriptangularjsjslint

Error: jslint gives me error here for bad looping


$http({
  method: 'POST',
  datatype: 'json',
  url: '/CreateUser',
  data: data
  cache: false
}).success(function(data) { //Error:jslint gives me error here for bad looping
  console.log(data.message);
}).error(function(error) {
  console.log(error.message);
});

I use jslint package in Atom Editor, where I pass callback response it gives me error Error:jslint gives me error here for bad looping what is this? Can someone explain to me?


Solution

  • you have two } in the success callback.

    $http({
        method: 'POST',
        datatype:'json',
        url: '/CreateUser',
        data:data
        cache: false
    }).success(function (data){
        console.log(data.message);
    }).error(function (error){
        console.log(error.message);
    });