मैं प्रलेखन में कई स्थानों पर Type
कीवर्ड पर आया हूं। उदाहरण के लिए as seen hereComponentRef
में componentType
संपत्ति है। इसे Type<any>
प्रकार कहा जाता है। आगे की खोज पर मुझे दस्तावेज़ों पर this entry मिलते हैं। यह कहता है: ES7 सजावट के रूप में आमंत्रित करें।कोणीय 2 में टाइप क्या है?
इसके अलावा GitHub पर up the source देख, मैं इन टिप्पणियों को खोजने:
/**
* @whatItDoes Represents a type that a Component or other object is instances of.
*
* @description
*
* An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by
* the `MyCustomComponent` constructor function.
हालांकि मैं अभी भी स्पष्ट नहीं है Type
क्या करता है के रूप में कर रहा हूँ। क्या मुझे कुछ बुनियादी याद आ रहा है ??
ऐसा लगता है कि जब डॉक्स उत्पन्न किया गया, कुछ बातें चारों ओर मिलाया गया। स्पष्ट रूप से [TypeDecorator] (https://github.com/angular/angular/blob/2.0.1/modules/%40angular/core/src/util/decorators.ts#L66) से "ES7 सजावट के रूप में आमंत्रित" आया था इंटरफेस। यह थोड़े समझ में आता है कि इसके कारण, दस्तावेज़ 'प्रकार' प्रकार के सामान्य कार्य से जुड़े थे जो 'टी' देता है, जो इसे संतुष्ट करता है। –