无法绑定到“数据",因为它不是“示教数据"的已知属性 [英] Can't bind to 'data' since it isn't a known property of 'teach-data'

查看:131
本文介绍了无法绑定到“数据",因为它不是“示教数据"的已知属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么会出现以下错误: Can't bind to 'data' since it isn't a known property of 'teach-data'.

Why do I get the following error: Can't bind to 'data' since it isn't a known property of 'teach-data'.

尝试时:

<teach-data *ngIf="selectedData" [data]="selectedData"></teach-data>

TeachDataComponent

TeachDataComponent

..some imports
export class TeachDataComponent implements OnInit {

    public requests;
    @Input() data;

    constructor(private http: Http, private JwtService:JwtService,
    private _service: NotificationsService) {
    }

    ngOnInit() {

    }

*在RC.4中工作

*在尝试升级到Angular 2 RC.5后已暂停

*Hapenned after trying to upgrade to Angular 2 RC.5

推荐答案

确保已遵循所有步骤2 :创建一个NgModule .尝试导入teach-data组件并将其添加到@NgModule语句的声明"部分.

Make sure you've followed all the steps for migrating to RC 5. In particular, step 2: Create an NgModule. Try importing the teach-data component and adding it to the "declarations" section of the @NgModule statement.

这篇关于无法绑定到“数据",因为它不是“示教数据"的已知属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆