संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
ब्लॉकली > fieldRegistry > रजिस्टर करें
फ़ील्डRegistry.register() फ़ंक्शन
फ़ील्ड टाइप को रजिस्टर करता है. fieldRegistry.fromJson, सही फ़ील्ड टाइप ढूंढने के लिए, इस रजिस्ट्री का इस्तेमाल करता है.
हस्ताक्षर:
export declare function register(type: string, fieldClass: RegistrableField): void;
पैरामीटर
पैरामीटर |
टाइप |
ब्यौरा |
टाइप |
स्ट्रिंग |
JSON की परिभाषा में इस्तेमाल किया गया फ़ील्ड टाइप का नाम. |
fieldClass |
RegistrableField |
fromJson फ़ंक्शन वाली फ़ील्ड क्लास, जो फ़ील्ड के इंस्टेंस को बना सकती है. |
लौटाए जाने वाले प्रॉडक्ट:
अमान्य
अपवाद
{गड़बड़ी} अगर टाइप का नाम खाली है, फ़ील्ड पहले से रजिस्टर है या फ़ील्ड क्लास कोई ऐसा ऑब्जेक्ट नहीं है जिसमें fromJson फ़ंक्शन शामिल हो.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया.
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया."],[],["The `fieldRegistry.register()` function registers a field type for use with `fieldRegistry.fromJson`. It takes two parameters: `type` (a string representing the field type name) and `fieldClass` (a class with a `fromJson` function for constructing field instances). It returns void. The function throws an error if the type is empty, the field is already registered, or the class is invalid. It enables the system to find the appropriate field type during JSON parsing.\n"]]