Create JSON object in Ionic SQLite
<p>I am a beginner in Ionic. So, I want to convert JSON string to JSON object in ionic and to access JSON in html page.</p>

<p>controller.js</p>

<pre><code>app.controller('OilTrackerListingCntrl', function($scope, $ionicPlatform, $cordovaSQLite) 
{
$scope.pTrackerData = '';
$cordovaSQLite.execute(dbApp, "SELECT TOTAL_KM, SERVICE_DATE, AMOUNT_PAID, NEXT_SERVICE_DATE FROM OIL_TRACKER")
                .then(
                    function(res) {
                        $ionicLoading.hide();
                        if (res.rows.length &gt; 0) {


                            for (var i = 0; i &lt; res.rows.length; i++) {

                                var varTrackerData = new TrackerData(res.rows.item(i).TOTAL_KM, res.rows.item(i).SERVICE_DATE, res.rows.item(i).AMOUNT_PAID, res.rows.item(i).NEXT_SERVICE_DATE);
                                SelectedTracker.push(varTrackerData);   
                            }
                            var d = JSON.stringify(SelectedTracker);
                            alert(d);
                            $scope.pTrackerData = d;
                            alert($scope.pTrackerData);
                        } else {
                            alert('Not getting');
                        }
                    },
                    function(error) {
                        alert("Error on loading: " + error.message);
                    }
                );
}
</code></pre>