Я создаю оператор, в котором я вставляю значения на основе ввода из выпадающего списка. И я могу создать заявление. Но когда я объединяю фрагменты оператора, я получаю «неопределенный» в начале и между ними. Что и почему это «неопределенный», я не могу определить. Пожалуйста помоги.
Кодирование в angular2, но я считаю, что это просто логическая проблема.
Логика -
код -
app.component.ts
// For arranging a unit and number of commas.
for (var i = 0; i < this.subNodeItemLength; i++) {
this.unit[i] = ", ( " + this.letter[i] + ":" + this.subnodeSelectItemtext[i] + " ) - [" + this.letter[i + 1] + " ] - ( " +
this.letter[i + 2] + ") ";
this.units.push(this.unit[i]);
console.log("units = ", this.units);
this.commas.push(this.comma);
console.log("commas", this.commas);
console.log("comma =", this.comma);
}
// Complete Statement
for (var i = 0; i < this.subNodeItemLength; i++) {
console.log("before statement logic = ", this.statement)
this.statement[i] += (this.units[i] + this.commas[i - 1]);
console.log("After logic, statement =", this.statement[i]);
}
console.log("final statement =", this.statement);
// After RETURN
for (var i = 0; i < this.subNodeItemLength; i++) {
this.afterReturn += this.letter[i] + this.commas[i - 1];
}
// Cypher Query
this.cypherQuery = "MATCH (xab:" + this.rootItemText + " ) OPTIONAL MATCH (xab: " + this.rootItemText + ")-[r1]-(p1)" +
this.statement + "RETURN xab,r1,p1 ," + this.afterReturn;
выход -
units = [", ( a:SMS ) - [b ] - ( c) "]
commas [","]
comma = ,
units = (2) [", ( a:SMS ) - [b ] - ( c) ", ", ( b:Collection ) - [c ]
- ( d) "]
commas (2) [",", ","]
comma = ,
units = (3) [", ( a:SMS ) - [b ] - ( c) ", ", ( b:Collection ) - [c
] - ( d) ", ", ( c:Payments ) - [d ] - ( e) "]
commas (3) [",", ",", ","]
comma = ,
before statement logic = []
After logic, statement = undefined, ( a:SMS ) - [b ] - ( c) undefined
before statement logic = ["undefined, ( a:SMS ) - [b ] - ( c) undefined"]
After logic, statement = undefined, ( b:Collection ) - [c ] - ( d) ,
before statement logic = (2) ["undefined, ( a:SMS ) - [b ] - ( c) undefined", "undefined, ( b:Collection ) - [c ] - ( d) ,"]
After logic, statement = undefined, ( c:Payments ) - [d ] - ( e) ,
final statement = (3) ["undefined, ( a:SMS ) - [b ] - ( c) undefined", "undefined, ( b:Collection ) - [c ] - ( d) ,", "undefined, ( c:Payments ) - [d ] - ( e) ,"]
NeoVis {_config: {…}, _encrypted: "ENCRYPTION_OFF", _trust: "TRUST_ALL_CERTIFICATES", _driver: Driver,
_query:
"MATCH (xab:Century ) OPTIONAL MATCH (xab: Century)…- ( e) ,RETURN xab,r1,p1 ,undefinedaundefinedb,c,", …}
neovis.js:36680 Error: Invalid input 'd': expected 'w/W' or 'i/I' (line 1, column 63 (offset: 62))
"MATCH (xab:Century ) OPTIONAL MATCH (xab: Century)-[r1]-(p1)undefined, ( a:SMS ) - [b ] - ( c) undefined,undefined, ( b:Collection ) - [c ] - ( d) ,,undefined, ( c:Payments ) - [d ] - ( e) ,RETURN xab,r1,p1 ,undefinedaundefinedb,c,"