1

I have to make 2 queries or more to get data from the server. for example the first i am getting general information like this:

http://azvsptcsdev02:678/_vti_bin/CPMD.WEBSERVICE/ProjectInfoService.svc/GetProjectDetails

on user click i need to show the summary of this project. so i need to pass the id to get the data what i requred, the url is :

http://azvsptcsdev02:678/_vti_bin/CPMD.WEBSERVICE/ProjectInfoService.svc/GetProjectByID/002

But how to make seperate query according to the page?

at present i am using a server.js like this:

(function () {

    "use strict";

    angular
        .module("tcpApp")
        .factory("server", ['$resource', function ($resource) {

            return $resource('http://azvsptcsdev02:678/_vti_bin/CPMD.WEBSERVICE/ProjectInfoService.svc/GetProjectDetails');

        }]);

})();

$scope.splash = server.query(); //getting json.

It works fine. But how to can update this for both request?

3gwebtrain
  • 14,640
  • 25
  • 121
  • 247

1 Answers1

0

my opinion don't need to get service call,

because your database values already you had.

if $scope.splash have your latest value, then you can get the object by using indexOf().

It's may be no sense. but it is a simple way. else you need call server by using separate query

update:-

  • I does not mean Seperate Query . I mean you need to pass parameter to the function, if the parameter have any value, then write second query , else you write a first query.

  • You can get the data from your $scope.splash array by using indexOf() function or map() or some() functions

Community
  • 1
  • 1
Ramesh Rajendran
  • 37,412
  • 45
  • 153
  • 234