2

Just wondering if anyone has any samples or links to instructions for running an angular 6 app on Sharepoint SPFX.

I have followed this example for Angular 5 but it will not work once I upgrade the angular dependencies

https://www.youtube.com/watch?v=_OgEqWtouuU

The error I get on the SPFX workbench when I try to add the webpart is

    [SPLoaderError.loadComponentError]:
***Failed to load component "a884f6f5-e74c-4932-972f-0e1431147413" (AppWebPart).
Original error: ***loadComponent() returned an empty object for component "a884f6f5-e74c-4932-972f-0e1431147413" (AppWebPart).

***INNERERROR:
***loadComponent() returned an empty object for component "a884f6f5-e74c-4932-972f-0e1431147413" (AppWebPart).
***CALLSTACK:
Error
    at SPLoaderError.SPError [as constructor] (https://localhost:4321/node_modules/@microsoft/sp-loader/dist/sp-loader-assembly_en-us.js:10183:24)
    at new SPLoaderError (https://localhost:4321/node_modules/@microsoft/sp-loader/dist/sp-loader-assembly_en-us.js:4211:28)
    at Function.ErrorBuilder.buildErrorWithVerboseLog (https://localhost:4321/node_modules/@microsoft/sp-loader/dist/sp-loader-assembly_en-us.js:3821:21)
    at Function.ErrorBuilder.buildLoadComponentError (https://localhost:4321/node_modules/@microsoft/sp-loader/dist/sp-loader-assembly_en-us.js:3743:21)
    at https://localhost:4321/node_modules/@microsoft/sp-loader/dist/sp-loader-assembly_en-us.js:7952:38

The code can be located at this link https://drive.google.com/file/d/1iF1Low1VYlK0RFYXf1KILZfcEuLnMIjx/view?usp=sharing

Any help is greatly appreciated.

Thank you Damien

1

Besides the link mentioned in comments, you can also checkout the Angular Elements - hello world webpart which uses Angular 6 and SPFx.

It is based on Angular Elements functionality which packages Angular components as custom elements quite similar to web components.

This is a hello world sample, but it also demonstrates couple other webparts as well which can make REST calls to SharePoint, Microsoft Graph, bootstrapping Angular Elements inside SPFx webparts etc.

  • Thank you @gautamsheth. Are Angular Elements fully supported in a production environment? I updated the sample to use a html file instead of an inline template. Is this a limitation or something I need to look at with the gulp file? – Damien Aug 1 '18 at 15:24
  • 1
    Not sure about production ready, but looks like it needs some polyfill support for Edge. You might need to look into gulp to use html or you check this link or this link, maybe it can give you some heads up. – Gautam Sheth Aug 1 '18 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.