Skip to content

Rule doesn't work as expected #430

@putuyoga

Description

@putuyoga

It seems that the rule doesn't work. i use config from eslint-config-angular Still can't figure it why. here is my .estlintrc

  "extends": ["angular"],
  "ecmaFeatures": {
        "blockBindings": true
  },
  "indent": ["error", 2],
  "env": {
    "browser": true,
    "jasmine": true
  },
  "globals": {
    "angular": true,
    "module": true,
    "inject": true
  }
}

and here is my controller look like:

    const controllerId = 'UserController';

    angular.module('inspinia')
        .controller(controllerId, UserController);

    UserController.$inject = ['UserService', '$compile', '$scope', '$q', 'CommonEnum', 'CommonService', '$uibModal', 'TenantService'];

    function UserController(UserService, $compile, $scope, $q, CommonEnum, CommonService, $uibModal, TenantService) {

        $scope.myform = {};
        $scope.UserList = [];
        $scope.errorMessage = {
            isError: '',
            message: ''
        }
        $scope.showLoadingOnTable = false;
        $scope.TenantId = '';

        $scope.findAll = function() {

            $scope.showLoadingOnTable = true;
            var request = {
                TenantId: $scope.TenantId
            }
            UserService.FindAllByTenantId(request)
                .then(function(response) {
                    $scope.UserList = response.data.Model;
                    $scope.showLoadingOnTable = false;
                })
                .catch(function(error) {
                    var response = CommonService.getErrorMessage(error);
                    $scope.errorMessage = {
                        isError: true,
                        message: response.message
                    }
                    $scope.showLoadingOnTable = false;
                });
        }
    }

it should trigger controller_as rule. But it didn't. Strange. Any advice?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions