1

I'm currently been using the angular-tree-ui component, which is a nice little component that allows nesting of hierarchical data with drag and drop support.

All has been going well until I started to pull the data from Asp.Net Web Api.

Originally the data is set as in angularjs:

var results = [{"id":1,"productName":"Test","nodes":[]}];

Which works fine.

But as soon as I use $http to connect to the Asp.Net Web Api which returns:

{"id":1,"productName":"Test","nodes":[]}

... the angular-tree-ui component complains with multiple errors.

"Cannot read property '$$hashKey' of undefined"

Why does it work with the manual creation of JSON but not with the JSON returned from the Asp.Net Web API?

2
  • You realize the first result set is an array and the second is an object?
    – Malk
    Commented Sep 3, 2014 at 17:50
  • The JSON that was been returned from the Asp.Net Web Api wasn't just {"id":1,"productName":"Test","nodes":[]} but it was also returning the headers in the JSON aswell. I only noticed after using {{data|json}} Commented Sep 3, 2014 at 18:55

0

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.