angucomplete icon indicating copy to clipboard operation
angucomplete copied to clipboard

Allow nested JSON property access

Open jarandaf opened this issue 9 years ago • 6 comments

Hi, first of all kudos for such directive, it's been useful :) Keep up the good work.

I have noticed it's not possible to access JSON nested properties from the response, which I would find really useful. For instance:

<angucomplete id="some-search" placeholder="Search" pause="400" selectedObject="selectedService" localdata="data" minlength="1" searchfields="service.name" titlefield="service.name" inputclass="form-control col-lg-4"/>

where data looks like:

[
  {
    "service": {
      "name": "A"
    },
    "otherStuff": {}
  },
  {
    "service": {
      "name": "B"
    },
    "otherStuff": {}
  }
]

Does it seem reasonable?

jarandaf avatar Mar 20 '15 11:03 jarandaf

yes i have the same issue as i want to access picture url from picture Object

picture: { data: { is_silhouette: false url: "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xfa1/v/t1.0-1/p50x50/10014998_6 } } so is there any way to do that. Regards

MoatazAbdallh avatar Mar 29 '15 22:03 MoatazAbdallh

Same here, I have a schema where Category>Products so I need Products.name, i can successfully do that with selectObject and ng-repeat but on printing not on the drop down. Thank You

iblong2iyush avatar Apr 15 '15 15:04 iblong2iyush

Any update on this? I am trying to bind the search-fields to location.address and does not seem to work.

jnystrom avatar Oct 23 '15 21:10 jnystrom

please post some code

singhay avatar Oct 23 '15 21:10 singhay

+1

uneess avatar Jul 03 '16 21:07 uneess

This would be very useful, especially when you're dealing with public APIs. A quick fix would be implementing a Angular Interceptor to adapt the response structure to your needs.

uneess avatar Jul 03 '16 21:07 uneess