对话框api路由办公室JS

时间:2019-11-22 12:09:19

标签: office-addins

我想使用Dialog API从excel中打开弹出窗口,但我不想使用URL,而是想使用诸如route.nagigate[("component")];之类的angular2路由 当我在应用模块中添加RouterModule.forRoot(Routes)时,显示error,页面无法加载。而且,如果我直接打开html,它将打开,但无法从Dialog向主机发送消息。

    Office.context.ui.displayDialogAsync(URl,options,function (asyncResult){
      console.log("And the response from callback", asyncResult);
      if (asyncResult.status == Office.AsyncResultStatus.Failed) {
          console.log("Could not open login page", event);
      }
      else{

        this.dialog = asyncResult.value;
        this.dialog.addEventHandler(Office.EventType.DialogEventReceived, dialogClosed);
        //this.dialog.addEventHandler(Office.EventType.DialogEventReceived, processDialogEvent);

        //Office.context.ui.messageParent("Success");
          console.log("Successfully opened");
      }
  });

0 个答案:

没有答案