Json parsing from server in tabs activity


#1

I’ve started an ionic app with the basic tabs activity. And for each tab page, there is a folder, which inturn has a html, ts and a scss file. The html file is a template within <ion-content>...</ion-content>. I now want to get a json encoded result from a server, for which I’m using the in-built angular http: service. I’ve coded a JS file with the controller for getting the results from the server:

angular
.module('deals_app')
.controller('deals_controller', function($scope, $http){
    
    $scope.result = "";
    $http.get('http://date.jsontest.com/')
        .success(function(data, status, headers, config){
            alert("success");
            $scope.result = data;
        })
});

Now my query is that how do I bind the controller to the DOM elements and where do I include the script tag with the JS file as src?


#2

You would probably get better results if you categorize your question appropriately. That doesn’t look like Ionic 2 to me.