I am using Servlets on server-side.So beside doGet() doPost() I also have 
user-defined functions like .
     
    void foo(...)
    {
       //Do some stuff
    }
    
    void bar(...)
    {
       //Do some stuff
    } 
Currently I am using $http get and post methods only to communicate with 
server.So I just need to pass a parameter and check its value on 
server-side depending upon which I decide whether to call foo() or bar().

Does AngularJS provide any direct/indirect mechanism by which I can pass 
data directly/indirectly to some function?

Like i can write something like to call foo()

    $some_service.post(){
    "method":"foo",
    "data":$scope.mydata
    }

If yes,can this be extended for other server-side technologies?

My approach 

 1. Attach a string with data which tells what function to call on servlet. 
Make a POST request.
 2. Read that string and pass data to appropriate function.
 3. Return result.

Problem : Tedious method and large if-else ladder.

P.S: A small working example or link will be of utmost help!



     

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to