Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Angular2-嵌入flash游戏-游戏出现片刻后消失_Javascript_Flash_Angular_Angular2 Routing - Fatal编程技术网

Javascript Angular2-嵌入flash游戏-游戏出现片刻后消失

Javascript Angular2-嵌入flash游戏-游戏出现片刻后消失,javascript,flash,angular,angular2-routing,Javascript,Flash,Angular,Angular2 Routing,-------------------编辑---------------------- 我缩小了问题的范围,这似乎是消毒液的问题。我创建了两个标记-一个带有硬编码路径,另一个带有DOMSanizer的输出。第一个工作正常,第二个什么也没做: //working <embed src="THE_HARD_CODED_URL" width="800" height="512" type="application/x-shockwave-flash"/> //not working &l

-------------------编辑----------------------

我缩小了问题的范围,这似乎是消毒液的问题。我创建了两个
标记-一个带有硬编码路径,另一个带有DOMSanizer的输出。第一个工作正常,第二个什么也没做:

//working
<embed src="THE_HARD_CODED_URL" width="800" height="512" type="application/x-shockwave-flash"/>

//not working
<embed [src]="safeUrl" width="800" height="512" type="application/x-shockwave-flash"/>
不用说,我检查了所有数据是否正确地传递到“游戏”组件-我打印了
safeUrl
,并获得了所需的链接

我对angular很陌生,所以可能我错过了一个基本的东西,但我看不到

谢谢

//game-list.component.html

    <a [routerLink]="['/game', game.id]">
       <img [src]="game.preview.thumbnailPath" />
    </a>
//game.component.html

    <h1>{{game.name}}</h1>
    <embed [src]="safeUrl" width="800" height="512" type="application/x-shockwave-flash"/>
//game.component.ts

this.safeUrl = this.domSanitizer.bypassSecurityTrustResourceUrl(this.game.embedUrl);