आईएम ग्राहक में मेरी लौटे संग्रह के परिणाम फ़िल्टर करके एक खोज बॉक्स बनाने की कोशिश कर।उल्का रेंज त्रुटि: अधिकतम कॉल स्टैक आकार पार हो गया। कुंजी दबाने घटना पर
लेकिन जब मैं वास्तव में खोज रहा कंसोल में ऊपर त्रुटि मिल रही है की कोशिश करो।
RangeError: Maximum call stack size exceeded.
यहां मेरे कोड पर एक नज़र डालें।
<body>
{{#isolate}}
<header class="row-fluid">
{{> modules}}
</header>
{{/isolate}}
<div id="main" class="span11">
{{#if currentUser}}
{{#isolate}}
{{> customers_list}}
{{/isolate}}
{{#isolate}}
{{> contacts_list}}
{{/isolate}}
{{/if}}
</div>
</body>
मॉड्यूल टेम्पलेट
<template name="modules">
{{templateLogger "modules"}}
<ul id="module_list" class="nav">
{{#each list}}
<li>
<a href="#" id="module_{{_id}}" module_id="{{_id}}" class="module">{{name}}</a>
</li>
{{/each}}
<form><input type="text" id="search"></form>
</ul>
और मेरे customers_list टेम्पलेट है कि मैं है फिल्टर करने के लिए परिणाम
<template name="customers_list">
<table class="table">
<tr>
<th>Name</th>
<th>Address</th>
<th>City</th>
<th>State</th>
<th>Zip</th>
<th>Phone</th>
</tr>
{{#each record}}
<tr>
<td>{{name}}</td>
<td>{{address}}</td>
<td>{{city}}</td>
<td>{{state}}</td>
<td>{{zip}}</td>
<td>{{phone}}</td>
</tr>
{{/each}}
</table>
</template>
कोशिश कर रहा हूँ और यहाँ के अंदर में मेरी खोज प्रपत्र खोज फ़ॉर्म
के लिए ईवेंट हैंडलरTemplate.modules.events({
'keypress input#search': function (event) {
Session.set("currentFilter", $('input#search'));
}
});
और फार्म सहायक परिणाम
Template.customers_list.record = function() {
qry = Session.get("currentFilter") || "";
if (qry != "") {
return Customers.find({$or: [ {'name': qry}, {'address': qry}, {'city': qry}, {'state': qry} ] });
} else {
return Customers.find({competitor: null}, {sort: {name: 1}});
};
}
मैं कोई सुराग नहीं क्या मैं क्या त्रुटि वह अपने एक अनंत की तरह लगता है के बारे में अन्य अतः पदों पर पढ़ने के लिए कर रहा था से इस त्रुटि पैदा कर रहा है प्रदर्शित करना लूप हालांकि वे उल्का विशिष्ट प्रश्न नहीं थे और मुझे नहीं पता कि इससे कोई फर्क पड़ता है या नहीं? अगर एक अनंत लूप भी है तो मैं इसे नहीं ढूंढ सकता।
कोई मदद आभारी होंगे।
धन्यवाद यह .val था(); गायब – Moshe
रेगेक्स के लिए धन्यवाद और साथ ही महान काम करता है। – Moshe