angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.32k stars 6.72k forks source link

bug(COMPONENT): Cannot use material components inside remote project which created by nx #24746

Closed ducvu212 closed 2 years ago

ducvu212 commented 2 years ago

Is this a regression?

The previous version in which this bug was not present was

No response

Description

I have a project which use Microfrontend architecture by NX.

Reproduction

Steps to reproduce: After i create remote project by command yarn nx g @nrwl/angular:app dashboard --mfe --mfeType=host --routing=true Inside project dashboard i generate component by using command nx g c list After that, i copy example in material home page (https://material.angular.io/components/list/overview#list-overview) but it show error `error NG8001: 'mat-list-item' is not a known element:

  1. If 'mat-list-item' is an Angular component, then verify that it is part of this module.
  2. If 'mat-list-item' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

4 Item 3


`
i imported all module of material guild in remote project module and root module but it dont working.

i tried with datePicker,.... but all component which require import to AppModule alway return this error.

But when i put this components into dashboard.html everything will work ok :( . Pls help me

![image](https://user-images.githubusercontent.com/20634152/162117314-fae773bc-090c-42cb-89fb-a1cf27e2839f.png)

### Expected Behavior

Can use material component inside nested component of remote project

### Actual Behavior

Cannot use material component inside  nested component of remote project

### Environment

- Angular: 13.2.0
- CDK/Material: 13.2.5
- Browser(s): Google Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): MacOs
zarend commented 2 years ago

Hello @ducvu212 ,

Hmmm, it looks like the module is not being imported. Also, I'm not sure if this is a bug or more of a support request, which would be best served by stackoverflow.

Here's a few suggestions on how we could best move forward with this.

Please let me know if this issue persists.

Thanks, Zach

zarend commented 2 years ago

Hello @ducvu212, Is this still an issue?

-Zach

wagnermaciel commented 2 years ago

Closing due to inactivity

angular-automatic-lock-bot[bot] commented 2 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.