angular 13 个 cli 抱怨 ng 服务上的组件输入

angular 13 cli complaining about component input on ng serve

Error: src/app/money_makers/shochat_guts/shochat_content_creator_components/active-stream-dashboard/shochatactivestreamview-shell/shochatactivestreamview-shell.component.html:14:40 - error NG8002: Can't bind to 'creatorcardimageurl' since it isn't a known property of 'app-shochat-contentcreator-chat'.
1. If 'app-shochat-contentcreator-chat' is an Angular component and it has 'creatorcardimageurl' input, then verify that it is part of this module.
2. If 'app-shochat-contentcreator-chat' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

14                                        [creatorcardimageurl]="grouproomsettings.creatorcardimageurl"

如果我们查看 shochatactivestreamviewshell

@Component({
  selector: 'app-shochat-contentcreator-chat',
  templateUrl: './shochat-contentcreator-chat.component.html',
  styleUrls: ['./shochat-contentcreator-chat.component.scss']
})
export class ShochatContentcreatorChatComponent implements OnInit, OnDestroy {

  constructor(private twilioconversationservice: TwilioConversationService) { }

  @Input() twiliochattoken = null;
  @Input() twiliochatid = null;
  @Input() creatorname = null;
  @Input() creatorcardimageurl = null;

如果我们去 app.module.ts

@NgModule({
  declarations: [
    AppComponent,
    ShochatContentcreatorChatComponent,
    
  ],

我们可以看到组件已经定义好了。是否有关于为什么会发生这种情况的明确解释?

在@NgModule

中添加模式并导出您的组件
  @NgModule({
          declarations: [
            AppComponent,
            ShochatContentcreatorChatComponent,
          
          ],
          exports: [ShochatContentcreatorChatComponent],
          schemas: [
            CUSTOM_ELEMENTS_SCHEMA,
            NO_ERRORS_SCHEMA
          ]
        })