嵌入组件时无法在 angular2 中加载 Silverlight

Unable to load Silverlight in angular2 when embedded in a component

当前行为
当直接在 HTML 页面中嵌入和加载 Silverlight.xap 时,它工作正常。但是当我们在组件中移动相同的代码时,它不会加载 Silverlight。 DOM 在这两种情况下,即通过 HTML 和通过组件嵌入和加载,没有任何区别。

Silverlight代码-app.Component.HTML页面
当我们直接加载此页面时,即 localhost/OurApp/Silverlight-app.Component.HTML,silverlight 内容被加载并且工作正常。但是当我们在浏览器中打开 index.html(它是我们的 angular2 的主要组件和 Silverlight-app.Component.HTML 页面是 index.html 的子组件)时,它不会加载 silverlight 内容。

<section>    
    <div>
        <object id="silverlightControlHost" data="data:application/x-silverlight-2," type="application/x-silverlight-2"
                width="100%" height="100%" style="min-height: 100%; height: 1000px">            
            <param name="source" value="clientbin/SilverlightApp.xap"/>
            <param name="onError" value="onSilverlightError" />
            <param name="background" value="white" />
            <param name="minRuntimeVersion" value="5.0.61118.0" />
            <param name="autoUpgrade" value="true" />            
            <param name="Windowless" value="true" />
            <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=5.0.61118.0" style="text-decoration: none">
                <img src="images/slmedallion.png" alt="Get Microsoft Silverlight" style="border-style: none" />
            </a>
        </object>
        <iframe id="_sl_historyFrame" style="visibility: hidden; height: 0px; width: 0px;
    border: 0px"></iframe>
        <iframe id="desktop" style="visibility: hidden; height: 0px; width: 0px; border: 0px"></iframe>
    </div>
</section>

Expected/desired 行为
无论是通过 HTML 还是通过组件加载,嵌入和加载 Silverlight 组件都应该具有相同的行为。

改变行为的动机/用例是什么?
我们正在将我们的 Silverlight 应用程序迁移到 Angular2。由于完成迁移需要数月时间,因此我们也保留了一些 silverlight 模块。

用于更好地理解问题的图片

这个例子正是您所需要的:)

https://github.com/lohiarahul/Angular2-Silverlight-Starter