Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differences in array return vs singular item #35

Open
ericfernance opened this issue Mar 31, 2016 · 0 comments
Open

Differences in array return vs singular item #35

ericfernance opened this issue Mar 31, 2016 · 0 comments

Comments

@ericfernance
Copy link

@andrewmcgivery right. So one thing I have discovered is that when returning a singular the soapclient puts the result inside the data.item property and when returning an array it's an array.

easier to explain with code.

   var $soap = this.$injector.get("$soap");
   $soap.post(endpoint, "method_name", {})
            .then(function (data) {
             if (typeof (data.item) !== "undefined") {
                // There's only 1 version!
                versions = [data.item];
            }
            else {
                versions = data;
            }

I'm not sure if it's better documenting this different in behaviour between array results and singular results or standardising the result in the angular-soap wrapper?

Eric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants