Hi Vladimir,
Can't you just jsonEncode $sql2 into $sql1? If you are using postgresql
there are some nice array helpers so the result is easier to work with.
in js you can iter over the key's and parse the keys, building an new
object.
Something like:
function aTest() {
var a= {
"ActionID": "1",
"Taskref": "1",
"Ast1_1": "",
"Ast2_1": "Start EVA watch\nopen hatch\nAssist CDR",
"Ast3_1": "",
"Ast1_2": "Egress cabin to LM porch\nReceive & jetttison
bag\nReceive ETB/LEC",
"Ast2_2": "Deploy CDR PLSS antenna\nHand jettison bag to
CDR\nHand ETB/LEC to CDR",
"Ast3_2": "",
"Ast1_3": "Descend lander to top rung\nUnlock and deploy
MESA\nLower ETB on LEC",
"Ast2_3": "Tape recorder -off\nVerify voice signals level and
uitlity floo [......]"
}
var result = {}
Object.keys(a).forEach(parser);
console.log(result);
function parser(key) {
var tmp = ""
if (key.substr(0,3) ==="Ast") {
tmp=key.substr(0,4);
result[tmp] = result[tmp] || []
result[tmp].push(a[key]);
} else {
result[key] = a[key];
}
}
}
Regards
Sander
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.