Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9066777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:47:44+00:00 2026-06-16T16:47:44+00:00

i have an json array like this //data.json { one: [ {name:john},{name:joe},{name:vicky} ], two:

  • 0

i have an json array like this

//data.json
{
"one":   [ {"name":"john"},{"name":"joe"},{"name":"vicky"} ],
"two":   [ {"name":"mark"},{"name":"nike"},{"name":"albert"} ]
}

//filter.js
angular.module('eventFilters', ['calenderServices']).filter('compare', function(Name) {
var e=Name.query();

return function(input) {
alert(e['one'].length) //-->displays nothing
}

i am trying to retrieve the length of the array “one” and “two”, but jsondata[‘one’].length is not returning the length, it is not displaying any thing. My angular restful services which i have used to get the json data from external file is correct, no doubt in that. since i am getting json data in filter, i couldn’t use $scope.e=Name.query(); so i tried using ‘var’, it was working fine with my old json data, but not with my new json file. what may be the problem?

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T16:47:45+00:00Added an answer on June 16, 2026 at 4:47 pm

    Not entirely sure what is the exact problem you are trying to solve here but the issue into which you are bumping here is that you’ve got an async call (.query()) that won’t return results immediately (I suspect that you are using $resource and its syntax might suggest that is synchronous, more info here: https://stackoverflow.com/a/11966512/1418796).

    Now, filters are not prepared to work with asynchronous results really so what you are trying to do here won’t work. Ultimately the issue is more linked to the asynchronous function calls that to filters.

    Would love to help more here but I’m not clear what you are trying to achieve, functionally speaking.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have json array like this one: [{code : A1, desc : desc1},{code :
I have a single array json string containing data: [{Name:John,Age:22}, {Name:Jack,Age:56}, {Name:John,Age:82}, {Name:Jack,Age:95}] I
I have a JSON array like this: { forum:[ { id:1, created:2010-03-19 , updated:2010-03-19
I have a json object that looks something like this: Array ( [algorithm] =>
I have something like a json array output, it comes like : { data:
i have this JSON: var projects_array = new Array( {name:myName1, id:myid1, index:1}, {name:myName2, id:myid2,
I have a JSON string like this of data for a table in an
I have JSON array with one object consisting of nodes and links. data =
I have a json file that looks like this: { status: 200, data: {
I have a json array like this: var headerStrings = [ Apple, Banana, Pineapple,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.