0

I have loaded a page using AngularJS. I have the following code:

var app = angular.module("adhocAnalytical",[]);
app.controller(
        "ReportController",
        function ($scope,$http) {

            $http({
                method: 'POST',
                url: '/campustoolshighered/k12_reports_adhocreport4_analytical_body.do',
                data: 'action=fetchinitdata',
                headers: {'Content-Type': 'application/x-www-form-urlencoded'}
            })
            .success(function(response) {
                $scope.questions = response;
                });
            }
    );

angular.element(document).ready(function (){
    angular.bootstrap(document,['adhocAnalytical']);
});

When we load a page second time in a current session using AngularJS, it does not load. It give only the expression written on the jsp page such as:

{{question.title}}
{{cell.f}}{{cell.f}}
{{row.h}} {{row.v}} {{row.v}}

1 Answer 1

1

Remove }; after the success callback:

app.controller(
        "ReportController",
        function ($scope,$http) {

            $http({
                method: 'POST',
                url: '/campustoolshighered/k12_reports_adhocreport4_analytical_body.do',
                data: 'action=fetchinitdata',
                headers: {'Content-Type': 'application/x-www-form-urlencoded'}
            })
            .success(function(response) {
                $scope.questions = response;
                });
            }

    );
Sign up to request clarification or add additional context in comments.

1 Comment

I have accidentally place the "};" after success callback while asking the question. I have no "};" in my code actually.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.