I generated a project with yo office
to create an office add-in based on Angular. When I add the @microsoft/mgt libs to that project (as per https://learn.microsoft.com/en-us/graph/toolkit/get-started/use-toolkit-with-angular) I get an error saying
SCRIPT5022: SCRIPT5022: Office.js has not fully loaded. Your app must call "Office.onReady()" as part of it's loading sequence (or set the "Office.initialize" function). If your app has this functionality, try reloading this page.
This happens when I add
Providers.globalProvider = new MsalProvider({
clientId: environment.clientID
});
to the ngOnInit() of the app.component.ts. Removing this statement loads Office just fine and lets me use my Addin. Is there anything I can do in my code to fix this? Or is this an imcompatibility between the two Microsoft libraries?