If '' is an Angular component, then verify that it is part of this module

前端 未结 16 3660
慢半拍i
慢半拍i 2020-12-07 14:09

I am new in Angular2. I have tried to create a component but showing an error.

This is the app.component.ts file.

import { Component } f         


        
16条回答
  •  被撕碎了的回忆
    2020-12-07 14:54

    Check which module the parent component is being declared in...

    If your parent component is defined in the shared module, so must your child module.

    The parent component could be declared in a shared module and not the module that is logical based on the file directory structure / naming, even the Angular CLI added it into the wrong module in my case.

提交回复
热议问题