Getting TypeError: Cannot read property 'get' of undefined when Using $http.get

hi guys,

i am getting this error and i didn’t find whats wrong (still learning )

typeError: Cannot read property ‘get’ of undefined

angular.module('', [])

.factory('EspritService', [function($http){

getData: function () {

            var parseGrades = function (response) {


                var tmp = document.implementation.createHTMLDocument();
                tmp.body.innerHTML =;

                var items = $(tmp.body.children).find('#__VIEWSTATEGENERATOR')[0].value;
                var items2 = $(tmp.body.children).find('#__EVENTVALIDATION')[0].value;
                var items3 = $(tmp.body.children).find('#__VIEWSTATE')[0].value;

                viewStategen = items;
                eventValidation = items2;
                viewStateval = items3;

                return items;

            return $http.get('')

and the controller

.controller('loginCtrl', ['$state','$scope', '$stateParams','EspritService', // The following is the constructor function for this page's controller. See
// You can include any angular dependencies as parameters for this function
// TIP: Access Route Parameters for your page via $stateParams.parameterName
function ($state,$scope, $stateParams,EspritService) {

    var vm = this;
    vm.doLogin = function () {

            .then(function(response) {
//will implement later
              /*  EspritService.login(vm.cin)



move on to ionic 2 :joy:

i already designed the app so moving to ionic 2 means redesigning

i solved this problem
i forgot to ‘$http’ before function