我生成了一个项目,yo office
用于创建基于 Angular 的办公插件。当我将 @microsoft/mgt 库添加到该项目时(根据https://docs.microsoft.com/en-us/graph/toolkit/get-started/use-toolkit-with-angular),我收到一条错误消息
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.
当我添加时会发生这种情况
Providers.globalProvider = new MsalProvider({
clientId: environment.clientID
});
到 app.component.ts 的 ngOnInit()。删除此语句可以很好地加载 Office,并让我使用我的插件。我可以在我的代码中做些什么来解决这个问题吗?或者这是两个 Microsoft 库之间的不兼容?