Home > Mobile >  AngularJS stuck in module
AngularJS stuck in module

Time:12-01

app.controller('TableContent', ['$http', '$scope', '$window',

function ($scope, $window) {
    console.log("I'm in TableContent");
    $scope.EditSaverCommit = function () {
        console.log("I'm in EditSaverCommit");
        EditIndex = $scope.$index;
        EditProjectID = $scope.project.ID;
        console.log("Scope has" $scope.project.Name);
        EditProject = $scope.project.Name;
        console.log("EditProject has " EditProject);
    };

    $scope.DeleteProjectCommit = function () {
        console.log("I'm in DeleteProjectCommit");
        $window.Project.splice($scope.$index, 1);
        ProjectLength = Project.length;
        PostData = "";
        $scope.Project = $window.Project;

        PostData = $scope.Project.ID;
        $http.get("https://localhost:44377/project/DeleteProject/" PostData).then(function (response) {
            console.log("I'm in DeleteProject");
            $window.Project = response.data;
        });
        PostData = "";
        console.log("I'm not in TableContent");
    };
}]);

Hello all, I've had an issue with this snippet when it comes to loading my page. After the entire page loads, all of my other http.get requests are down ever since I modified this part to accept http.get. It doesn't print the "I'm not in TableContent" after full load and all other http.get requests are paralyzed but do print their respective console.log() messages.

CodePudding user response:

Parameter $http is missing as function argument:

app.controller('TableContent', ['$http', '$scope', '$window',
function ($http, $scope, $window) {
  ...
}
}]);

This cracks the dependency injection...

  • Related