0
public interface IService1
{
    [OperationContract]
    [WebGet(BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json,
         ResponseFormat = WebMessageFormat.Json, UriTemplate = "GetEmployeeA?id={id}")]
    EmployeeA GetEmployeeA(int id);

    [OperationContract]
    [WebGet(BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json,
        ResponseFormat = WebMessageFormat.Json, UriTemplate = "GetEmployeeJSON?str={str}")]
    string GetEmployeeJSON(string str);
}

I want to call the above methods using angularJS script... I tried httpget() with param:

$http({ url: yourURL, method: "GET", params: {: params:" ''} }); 
2
  • i want to call the above methods using angularJS script...I tried httpget() with param Commented May 19, 2016 at 8:29
  • $http({ url: yourURL, method: "GET", params: {: params:" ''} }); Commented May 19, 2016 at 8:32

1 Answer 1

1

What's the concrete problem? If you do it like this, it should work just fine:

$http({
    url: "http://yourURL/GetEmployeeA", 
    method: "GET",
    params: {id: 123}
});

resp.

$http({
    url: "http://yourURL/GetEmployeeJSON", 
    method: "GET",
    params: {str: 'foo'}
});
Sign up to request clarification or add additional context in comments.

3 Comments

khlr sir please tell me is there any angularJs specific library required for that or its work with /angular.min.js library
This is part of the regular AngularJS library. Here, have a look at the docs.
sir its working but result is obtained only if we use internet explorer, but for other browsers its does not show anything..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.