Ionic6: did you add it to @ ngmodule.entrycomponents

Explain the function of static keyword and final keyword in Java in detail>>>


Error: no component factory found for logincomponent. Did you add it to @ ngmodule.entrycomponents in my last article: Mobile Development: ionic framework to achieve registration and login function, the login page will pop up when the software is running, using component.

However, an error was reported in the last run. I checked the information on the Internet, which means that my current code is written in the old version of ionic, while my ionic version is 6.6.0 . This problem occurs because I did not introduce this component into the module where the page of this component is located

Solutions (1)

find the code of the module (XXX. Module. TS) where the page is located, and modify it as follows:

is to add entrycomponents: [logincomponent] to solve the above problems. And add logincomponent in declarations , otherwise the "component logincomponent is not part of any ngmodule or the module has not been imported into your module." error will appear

Solution (2) recommend

the first method only aims at the case that the component is used once. If the component is used by multiple pages, new problems will appear in the solution

find the code of the project app.module.ts file and modify it as follows:

Add: logincomponent in entrycomponents and declarations respectively; The principle and method 1 are the same, but the files added are different

Similar Posts: