我正在尝试打印一个数组。如果我在this.profile.classifications.classification
处停止工作并在我添加Math
时返回this.profile.classifications.classification.subclassification
,则不会返回任何内容。我在这做错了什么?
路径:mongoDB
"classifications": {
"classification": "Math",
"subclassification": [
"Class A",
"Class B",
"Class C"
]
}
路径:helper.js
candidateSpecialisation: function () {
var specialisations = (this.profile && this.profile.classifications && this.profile.classifications.classification && this.profile.classifications.classification.subclassification) ? this.profile.classifications.classification.subclassification.toString() : '';
return specialisations.replace(/,/g, ", ");
},
路径:template.html
<p>{{candidateSpecialisation}}</p>