不重新调整变量

时间:2016-03-22 04:23:37

标签: meteor

我正在尝试打印一个数组。如果我在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>

0 个答案:

没有答案