typescript - Angular app.module.ts not compiling, NgModule not declared, and component import issues - Stack Overflow

I created a basic Angular project in VS Code, but the app.module.ts file was missing, so I manually cre

I created a basic Angular project in VS Code, but the app.module.ts file was missing, so I manually created it and added @NgModule. I then generated a new component named user and imported this user component in app.module.ts, but I got an error.

However, when I imported the user component in appponent.ts, it worked. It seems like app.module.ts is not being compiled properly. Additionally, I am getting an error saying NgModule is not declared. How can I resolve this issue?

Errors:

X [ERROR] NG8001: 'app-use' is not a known element:

  1. If 'app-use' is an Angular component, then verify that it is included in the '@Component.imports' of this component.
  2. If 'app-use' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@Component.schemas' of this component to suppress this message. [plugin angular-compiler]

X [ERROR] NG8003: No directive found with exportAs 'ngForm'. [plugin angular-compiler]

I expected the app.module.ts file to compile correctly and recognize @NgModule and other Angular decorators.

I expected the user component to be successfully declared in app.module.ts without any issues.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745348855a4623704.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信