How we can clear objects in js after data populated in cshtml

Viewed 13

I have below code in my web application and have fetched data using ajax call and loaded my cshtml page, but after loading certain time my web page throwing aw!snap error in google chrome.

function Getdata() {
        try {
            $http.post(RootURL + '`mycontroller/GetDetails').then(function (response) {
                //Reload Error page          
                if (response.data.iserror) {
                    // load error
                }
                else {
                    if (response.data != undefined) {
                        $scope.dataList= [];
                        $scope.dataList= response.data.result;
                    }
                }
            }).catch(function () {
                onComplete();
            });
        }
        catch (e) {
// UI catch e
        }
    }

we see web suggestions to clear objects after assigning into UI controls. Can anyone help me out in this?

How to clear objects in js after assignment?

0 Answers
Related