2016-09-16 4 views
15

RC5で構築した私のアプリケーションを最終リリースにアップグレードしましたが、今はディレクティブとパイプを宣言する方法が混乱しています。私はこのエラーを取得しています:角度2.0リリース:パイプとディレクティブは@Componentのプロパティではありません

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コンポーネントから 'directives'を削除しましたか? –

+1

私の質問を削除するためのsry: "宣言に追加した後でも、私に同じエラーが表示されます" @StefanSvrkotaはい私はしました。面白いことです:パイプは動作しますが、エラーは私のcliに表示されます。 –

関連する問題