In my Angular project, I have a few components that are currently not being used but are kept for future development. Despite removing these components from the 'declarations' in their respective modules, they are not fully de-registered. Whenever I restart the server or create a build, the removed components throw errors indicating that they cannot find the necessary dependencies.
For example, when I removed the 'compiler' component from the 'portal.module.ts' declaration, it still showed an error stating it could not find 'mat-icon.'
https://i.sstatic.net/t0jdj.png
Although removing the entire folder resolves the issue after removing the declaration, I prefer to keep the component folder at this time. My expectation is that once I remove a component from the declaration, I should be able to run my project smoothly without needing those removed folders.
Is there any workaround to address this situation?