Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • JSON Parser Not prasing the array in JSON

    • 0
    • 0
    • 0
    • 1
    • 0
    • 0
    • 0
    • 655
    Answer it


    I have a project I'm working on, and I've run into 2 problems. The first is my JSON parser is parsing correctly for regular objects, but doesn't parse the arrays in the JSON.

    Secondly, I am trying to implement dependencies in my view. so if an item is checked, its dependencies should automatically be selected too.

    I am coding in anglarJS. any help would be hugely appreciated.


 1 Answer(s)

  • JSON.parse() should parse arrays just fine, assuming your string is valid JSON.

    For instance,

    var a = JSON.parse("[1,2,3]");

    should set a equal to

    [1, 2, 3]

    Can you post your actual JSON string?

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: