How to send data in $http function?


We have created a rest api and gets the json array by $_GET .But we want to post the data to another page .How can we do it? We want to pass from index.html page through API to retreive all the data related to that only .How can we pass that id and post the data on the new page say index2.html?

[quote="Jiten_08, post:1, topic:46704"]
om index.html

For the sake of simplicity, i will not use services but note that it is a good practice to code your business logic in the model/service layer

  1. in the controller for index.html, set the as global like so
    $rootScope.catId =;

  2. in controller for index2.html
    let us do a mock controller for index2.html

    .controller(‘index2Ctrl’,function($scope, $http){
    $scope.cats = {};
    var url = ‘yourRestApi/’+$scope.catId;
    $scope.cats = cats