मैं कोणीय 2 में शुरुआती हूं और मैं अंतिम कोणीय 2 रिलीज संस्करण का उपयोग कर रहा हूं। मुझे इसके साथ एक अजीब समस्या है। यह मेरा databinding.component.ts कोड है:कोणीय 2 त्रुटि ('निर्देश' प्रकार 'घटक' में मौजूद नहीं है)
import { Component } from '@angular/core';
import {PropertyBindingComponent} from './property-binding.component';
import {EventBindingComponent} from './event-binding.component';
@Component({
selector: 'fa-databinding',
templateUrl: 'databinding.component.html',
styleUrls: ['databinding.component.css'],
directives: [PropertyBindingComponent, EventBindingComponent]
})
और यह मेरा app.module.ts की शांति कोड है:
import { PropertyBindingComponent } from './databinding/property-binding.component';
import { EventBindingComponent } from './databinding/event-binding.component';
@NgModule({
declarations: [
AppComponent,
OtherComponent,
AnotherComponent,
DatabindingComponent,
PropertyBindingComponent,
EventBindingComponent
]
इस कोड को सही ढंग से काम नहीं करता है:
ERROR in [default] /home/tornado/work/first-app/src/app/databinding/databinding.component.ts:11:2
Argument of type '{ selector: string; template: any; styles: any[]; directives: (typeof PropertyBindingComponent | ...' is not assignable to parameter of type 'Component'.
Object literal may only specify known properties, and 'directives' does not exist in type 'Component'.
मुझे क्या करना चाहिए?!?
@ कॉम्पोनेंट त्रुटि के अंदर [कोणीय 2 संस्करण आरसी 6 "निर्देश" का संभावित डुप्लिकेट (http://stackoverflow.com/questions/39410591/angular2-version-rc-6- डायरेक्टिव-inside-component-error) – Fiddles