Javascript Can';t绑定到';控制';因为它不是';t(myComponent)的已知属性

Javascript Can';t绑定到';控制';因为它不是';t(myComponent)的已知属性,javascript,angular,Javascript,Angular,这是我的app.module.ts import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { HttpModule } from '@angular/http'; import { AppComponent } from './app.component'; // import { CountryDetailsComp

这是我的app.module.ts

import { NgModule }      from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpModule }    from '@angular/http';
import { AppComponent }  from './app.component';
// import { CountryDetailsComponent} from './country-detail.component';
// import { LandingPageComponent} from './landing-page.component';
import { routing } from './app.routing'
import { TypeaheadModule } from 'ng2-bootstrap/components/typeahead';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { TabsModule } from 'ng2-bootstrap/ng2-bootstrap';
import { CollapseModule } from 'ng2-bootstrap/ng2-bootstrap';
import { AlertModule } from 'ng2-bootstrap/ng2-bootstrap';


@NgModule({
    imports:      [ BrowserModule, HttpModule, routing, FormsModule, ReactiveFormsModule, TypeaheadModule, TabsModule, CollapseModule, AlertModule],
    declarations: [ AppComponent ],
    providers: [],
    bootstrap:    [ AppComponent ]
})
export class AppModule { }
我有两个组件:

从“../error messages.component”导入{ErrorMessagesComponent}; 从“../validation.component”导入{ValidationComponent}; 从“./气体类型”导入{GasType}

但我得到了这个错误:

Can't bind to 'control' since it isn't a known property of 'error-messages'.
1. If 'error-messages' is an Angular component and it has 'control' input, then verify that it is part of this module.
2. If 'error-messages' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
 ("nputPriceFormat"
                           name="priceFormat">
                    <error-messages [ERROR ->][control]="productionForm.controls.priceFormat"></error-messages>
                  </div>
          "): b@43:36
无法绑定到“control”,因为它不是“error messages”的已知属性。
1.如果“错误消息”是一个角度组件,并且具有“控制”输入,则验证它是否是该模块的一部分。
2.如果“错误消息”是Web组件,则将“自定义元素\u架构”添加到此组件的“@NgModule.SCHEMA”以抑制此消息。
(“nputPriceFormat”
name=“priceFormat”>
][control]=“productionForm.controls.priceFormat”>
"): b@43:36

我应该如何修复此问题?

该组件需要注册到
@NgModule()


我看不到您在
AppModule
中包含
组件
它在
CountryDetailsComponent
中注册并使用了
countrydetails.component.html
您使用的是什么Angular2版本?在组件中注册组件、指令和管道不再受支持,因为RC.6我如何检查版本sion?此注册适用于其他组件。Rhaps you systemjs配置文件。我不知道,我没有积极使用TS。
import { Component, Input } from '@angular/core';
import { FormGroup, FormControl } from '@angular/forms';
import { ValidationComponent } from './validation.component';

@Component({
  selector: 'error-messages',
  template: `<div style="color:#E82C0C; margin: 6px 0;" *ngIf="errorMessage !== null">{{errorMessage}}</div>`
})
export class ErrorMessagesComponent {
  @Input() control: FormControl;
  constructor() { }
              <div class="col-lg-10 ">
                <input class="price-format form-control" type="text"
                       [formControl]="productionForm.controls.priceFormat"
                       [(ngModel)]="productionConfig.priceFormat"
                       id="inputPriceFormat"
                       name="priceFormat">
                <error-messages [control]="productionForm.controls.priceFormat"></error-messages>
              </div>
Can't bind to 'control' since it isn't a known property of 'error-messages'.
1. If 'error-messages' is an Angular component and it has 'control' input, then verify that it is part of this module.
2. If 'error-messages' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
 ("nputPriceFormat"
                           name="priceFormat">
                    <error-messages [ERROR ->][control]="productionForm.controls.priceFormat"></error-messages>
                  </div>
          "): b@43:36
declarations: [ AppComponent, ErrorMessageComponent ],