Feb 11 2018 06:23 AM
Hi,
I am trying to create SPFx multiple web parts with Angular 4. I have created 'App' folder under webparts folder and trying to run the project. I am able to run first web part but when adding second webpart , It is throwing errors.
I am attaching my code here.
Can you please suggest, How can I use angular 4 with only one app folder in SPFx with multiple webparts?
Thanks,
Gaurav
Nov 27 2019 02:56 AM - edited Nov 27 2019 03:10 AM
i also face exact issue in spfx web part. i am searching the solution ofr this. if you got the solution for this issue please share answer with me. following are packages :
Nov 27 2019 02:36 PM
@Gaurav Goyal This is an issue with how Angular bootstraps it's solutions. In the Angular 2+ world, only 1 "app" can live on a page at a time. Because of this, it doesn't really work when you want to use it in SharePoint.
In order to make it work, you'd need to use Angular Elements. Which has many cons. For more information, check out Andrew Connell's blog on this matter.
https://www.andrewconnell.com/blog/using-angular-elements-in-sharepoint-framework-projects