Hi All,

Please see below:

In my JS file. I have the code below

var StudentSummaryModel = {
        iTotal: 0,
        iMaleTotal: 0,
        iFemaleTotal: 0
    };


 $scope.studentsummarymodel = StudentSummaryModel;
 $scope.staffsummarymodel = StaffSummaryModel;


$http.get(url).success(function (data, status, headers, config) {

                // hide wheel
                mySharedService.triggerWheel(false);

                // new message $scope.InitialMessage
                $scope.InitialMessage = "DJascol dashboard data : Summary";

                // reset StudentSummaryModel
                $scope.studentsummarymodel.iTotal = data.studentData.iTotal;
                $scope.studentsummarymodel.iFemaleTotal = 
data.studentData.iFemaleTotal;
                $scope.studentsummarymodel.iMaleTotal = 
data.studentData.iMaleTotal;
                                
                // reset StaffSummaryModel
                $scope.staffsummarymodel.iTotal = data.staffData.iTotal;
                $scope.staffsummarymodel.iFemaleTotal = 
data.staffData.iFemaleTotal;
                $scope.staffsummarymodel.iMaleTotal = 
data.staffData.iMaleTotal;
                
                // update graph
                mySharedService.LoadData(data.studentData.iMaleTotal, 
data.studentData.iFemaleTotal, "studentChart");
                mySharedService.LoadData(data.staffData.iMaleTotal, 
data.staffData.iFemaleTotal, "staffChart");
                
            }).error(function (data, status, headers, config) {

                // hide wheel
                $scope.triggerWheel(false);

                $scope.errorMessage = "Data: " + data + "<hr />status: " + 
status + "<hr />headers: " + headers + "<hr />config: " + config;
                $scope.hasError = true;

                // return data
                return data;

            });

If I comment out the 2 functions mySharedService.LoadData( ... ) I am able 
to access the updated values of iTotal, iMale and iFemale in 
studentsummaryData. However, I need the mySharedService.LoadData ( ... ) to 
be called after successfully getting data from the server. All I get in the 
HTML is {{studentsummaryData}} and not the actual value. 

Please can anyone help?

Thank you in anticipation.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to