मैं Knockout.js वस्तु निम्नलिखित है:Knockout.js - मैं एक गणना योग्य अवलोकन के अंदर एक अवलोकन योग्य संपत्ति का मूल्य कैसे प्राप्त करूं?
var viewModel = {
description : ko.observable(""),
Name : ko.observable(""),
productid : ko.observable(""),
productmodel : ko.observable(""),
productnumber : ko.observable(""),
text_relevance : ko.observable(""),
mydunamicfield : ko.computed(function() {
return "bq=(and " +
((this.description == "") ? "" : ("description:" + this.description + " ")) +
")";
} , this)
};
लेकिन mydunamicfield
संपत्ति सही श्रेणीबद्ध परिणाम उत्पादन नहीं है। अगर मैं एक और समारोह के अंदर संदर्भ के लिए this.description()
कोशिश, मैं त्रुटि संदेश निम्न देखें जब पेज लोड हो रहा है:
Property 'description' of object [object Window] is not a function
इस मामले में क्या समस्या है?