Search code examples
angularjsangularjs-ng-repeatangularjs-ng-clickrectangles

how to get a json variable Whose value contains a "-"


i have a json object that contains :

                  {
                    "-database": "URL",
                    "-id": "Veveve",
                    "value": [
                        "*.serse.pl/*",
                        "*.qq.serser/*",

                        ]
                    }

my question is : after Accepted the json at the Clint and saved my json object at my myjson Virabel how i set the "-id" value at ba-panel-title="" ?

**when i do myjson.-id i got a 'undefined` parameter

Thank you


Solution

  • Use myjson["-id"]

    console.log(myjson["-id"]);
    

    DEMO

    var myjson = {
      "-database": "URL",
      "-id": "Veveve",
      "value": [
        ".serse.pl/",
        ".qq.serser/"
      ]
    };
    
    console.log(myjson["-id"]);