Can't bind to 'information' since it isn't a known property of 'app-search' --angular5

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/renmengmeng520/article/details/81537525
问题

今天小编在做前端的时候,出现了以下问题:
这里写图片描述
Can’t bind to ‘information’ since it isn’t a known property of ‘app-search’.即
无法绑定到“information”,因为它不是“app-search”的已知属性错误。

解决

自己解决无果后,请来了位前端大神,一起来看下是怎么解决的吧:

原因:app-search是一个angular组件,缺少相关引用
操作:
在app.module.ts,workspace.module.ts,score-manage.module.ts
中分别引入如下代码:

import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CustomComponent } from './custom.component';

@NgModule({
  declarations: [ CustomComponent ],
  exports: [ CustomComponent ],
  imports: [ CommonModule ],
  schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
})
export class CustomModule {}

备注:如果原来的代码里有重复的代码,删掉保留一个即可。

小结

多尝试,不抛弃不放弃。

猜你喜欢

转载自blog.csdn.net/renmengmeng520/article/details/81537525