2016-09-16 12 views
15

मैंने अपने ऐप को अभी अपग्रेड किया है जिसे मैंने आरसी 5 पर अंतिम रिलीज में बनाया था, और मैं इस तरह से उलझन में हूं कि मुझे निर्देश और पाइप्स घोषित करना चाहिए।कोणीय 2.0 रिलीज: पाइप्स और निर्देशक @ कॉम्पोनेंट के गुण नहीं हैं

ERROR in [default] C:\xampp\htdocs\meriem-car\public\src\app\components\administration.component.ts:12:4 Argument of type '{ moduleId: string; selector: string; directives: typeof LoginComponent[]; templateUrl: string; }' is not assignable to parameter of type 'Component'. Object literal may only specify known properties, and 'directives' does not exist in type 'Component'.

उत्तर

33

RC6 के बाद से सभी निर्देशों और पाइप्स मॉड्यूल के declarations ले जाया जाना चाहिए: मैं इस त्रुटि मिल रही है।

@NgModule({ 
    imports: [...], 
    declarations: [ 
     //you insert your Components, Directives and Pipes here 
    ], 
    bootstrap: [...], 
    providers: [...] 
}) 

export class AppModule { } 
+2

जिसने इसे किया, धन्यवाद :) –

+0

@ESturzenegger क्या आपने अपने घटक से 'निर्देश' हटा दिए हैं? –

+1

मेरे प्रश्न को हटाने के लिए sry: "घोषणाओं में इसे जोड़ने के बाद भी, यह मुझे एक ही त्रुटि दिखाता है" @StefanSvrkota हाँ मैंने किया। मजाकिया बात यह है कि: पाइप काम करता है लेकिन मेरी क्ली में त्रुटि दिखाती है। –

संबंधित मुद्दे