Ошибка Angularjs

0

Я получаю сообщение об ошибке TypeError: Не могу прочитать свойство "get" undefined.i пробовал так много способов, но не смог его решить.

mycode - login.controller.js

(function () {
    'use strict';

    angular
        .module('app')
        .controller('LoginController', LoginController);

    LoginController.$inject = ['$location', 'AuthenticationService', 'FlashService'];
    function LoginController($location, AuthenticationService, FlashService) {
        var vm = this;

        vm.login = login;

        (function initController() {
            // reset login status
            AuthenticationService.ClearCredentials();
        })();

        function login() {
     var  usename=vm.username;
     var   password=vm.password;

            vm.dataLoading = true;

       $http.get('http://localhost:8080/ProjectManagement/REST/Login/Check?usename='+usename+'&password='+password+'').success(function(data, status, headers, config,response){

              if (data=="0")
                  {

                  }
              else
                  {


                  }


        }).error(function(data, status, headers, config,response) {


        });

        };
    }

})();
Теги:

1 ответ

1

Вы пропустили добавление зависимостей $http внутри контроллера, убедитесь, что все зависимости были введены перед использованием.

Код

LoginController.$inject = ['$location', 'AuthenticationService', 'FlashService', '$http'];
function LoginController($location, AuthenticationService, FlashService, $http) {
  • 0
    да код работает спасибо
  • 0
    @PanduKoturu принять ответ тогда .. Спасибо :)

Ещё вопросы

Сообщество Overcoder
Наверх
Меню