Javascript 带有Angular 2的DialogAPI:使用displayDialogAsync在对话框内播放我的Angular 2组件

Javascript 带有Angular 2的DialogAPI:使用displayDialogAsync在对话框内播放我的Angular 2组件,javascript,angular,angular2-routing,office-js,Javascript,Angular,Angular2 Routing,Office Js,我是Angular 2和office js的新手。我阅读了displayDialogAsync并创建了一个示例 现在我的工作示例显示html页面,但我想在office js对话框中显示angular 2组件,然后尝试将其重定向到不同的域 HTML页面:Waiting.HTML(仅等待2秒) app.Component.html:: <div> <router-outlet></router-outlet> <br /> Testing..

我是Angular 2和office js的新手。我阅读了displayDialogAsync并创建了一个示例

现在我的工作示例显示html页面,但我想在office js对话框中显示angular 2组件,然后尝试将其重定向到不同的域

HTML页面:Waiting.HTML(仅等待2秒)

app.Component.html::

<div>

<router-outlet></router-outlet>
    <br /> Testing...
    <div class="ms-Grid">
        <div class="ms-Grid-row">
            <div class="ms-Grid-col">
                <input type="button" value="OpenDialog" (click)="openDialog()" />
            </div>
        </div>
    </div>
</div>
预期结果:

在对话框中显示任何组件,然后重定向到customdomin,从customdomain获取响应并将其传递给我们的office加载项

请帮帮我


提前感谢。

在等待更好的答案时,请看一下本文的最后一节,它是关于在单页加载项中使用对话框的

import { Component, OnInit, Input } from '@angular/core';
import { WordService } from './office/word.service';
import { Router, ActivatedRoute, ActivatedRouteSnapshot, NavigationEnd, RouterStateSnapshot, Event, UrlSerializer } from '@angular/router';
import { Location } from '@angular/common'

@Component({
    moduleId: module.id,
    selector: 'addin',
    templateUrl: 'app.component.html',
    providers: [WordService]
})

export class AppComponent implements OnInit {
    title: string = 'Angular 2 Excel Add-in';
    private newURL: string;
    constructor(private wordService: WordService, private _router: Router, private _activatedroute: ActivatedRoute,
        private urlSerializer: UrlSerializer,
        private location: Location) {}
    ngOnInit() { }

    openDialog() {

        this.newURL = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + "/Waiting.html";
        Office.context.ui.displayDialogAsync(this.newURL, { height: 50, width: 50 });
        //Office.context.ui.displayDialogAsync(this._router.navigate(['login/test']), { height: 20, width: 20 });        
    }
}