I need to create a single JSON object called args with 2 attributes/property, key1 and key2.
Currently this is what I have but it is not being parsed correctly...
var args:{
'key1': $scope.args.users,
'key2': 'http://financialsystems.sungard.com/'
}
where $scope.args.users is an array:
$scope.args.users = [
{id: '1', firstName: 'Geraldine', lastName: 'Roberts', email: 'geraldine.roberts@email.com', country: 'South Africa'},
{id: '2', firstName: 'Walter', lastName: 'Mitty', email: 'w.mitty@email.com', country: 'USA'}
];
Where am I going wrong? Should there be another set of braces around each attribute/property?
{}
around yours args
needs to be "args"
"
not '
. 'key1'
needs to be "key1"
, etc Such:
{
"args": {
"key1": [
{
"id": "1",
"firstName": "Geraldine",
"lastName": "Roberts",
"email": "geraldine.roberts@email.com",
"country": "South Africa"
},
{
"id": "2",
"firstName": "Walter",
"lastName": "Mitty",
"email": "w.mitty@email.com",
"country": "USA"
}
],
"key2": "http://financialsystems.sungard.com/"
}
}
Replace :
to =
var args = {
'key1': $scope.args.users,
'key2': 'http://financialsystems.sungard.com/'
};
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.