manish jadli
manish jadli

Reputation: 29

error NG2012: Component imports must be standalone components, directives, pipes, or must be NgModules

If we add some dependency in angular standalone component and app.module then show this error:

error NG2012: Component imports must be standalone components, directives, pipes, or must be NgModules

enter image description here

enter image description here

Upvotes: 0

Views: 3148

Answers (2)

bickerin
bickerin

Reputation: 1

I had a simular issue where I could not get the ButtonModule to import within the Angular Component. I tested this by adding ButtonModule to the Stackblitz link from Suresh and it worked. I eventually reinstalled the Button component and that seemed to have corrected the issue.

Upvotes: 0

Based on the shared details, we have confirmed successful import of the “TreeViewModule” from the “@Syncfusion/ej2-angular-navigations” package without encountering any reported issues.

We have attached a sample for your reference.

Sample : https://stackblitz.com/edit/angular-1d5jjb-kfhrd6?file=src%2Fapp.component.ts

Additionally, we have provided the user guide documentation that explains the steps required to create a simple Angular TreeView component, and configure its available functionalities.

Documentation : https://ej2.syncfusion.com/angular/documentation/treeview/getting-started

Upvotes: 0

Related Questions