Has anyone tried using Angular 4 within a SharePoint hosted add-in? I've followed a variety of examples like these that are working with Angular 2 but once i try to replicate with Angular 4 i get obscure errors when i publish the add-in.
Examples i've used: https://www.youtube.com/watch?v=ZnQy3Hgl7lE https://askmanisha.wordpress.com/2016/08/10/create-basic-sharepoint-add-in-using-angular-2/
I've noticed that Angular modules were broken down further for Angular 4 and suspect that may be part of the issue, that i've referencing incorrect libraries or failing to include some key ones. Has anyone tried this and made it work?
Since you are using SP Online you should use the SPFx and dodge the classic web part design, the same is also valid for SP 2016:
https://dev.office.com/sharepoint/docs/spfx/sharepoint-framework-overview
Once you are familiar with SPFx architecture, you will need to first bootstrap your web part:
Then you install the Angular 1.6.5 available from NPM:
Once Angular is installed you can upgrade to Angular 4:
And import Angular to your code: