【发布时间】:2019-10-16 09:04:58
【问题描述】:
我需要有关如何将 iframe 中的参数从外部应用程序传递到 Angular 应用程序组件的帮助。
我的 iframe 看起来像这样:
<iframe src="http://localhost:4200?idfiches=123456"></iframe>
http://localhost:4200 是我的 Angular 应用程序的网址
在我的应用程序组件中,我尝试了类似的方法,但它不起作用:
parameterIdfiches: any;
constructor(private activeRoute: ActivatedRoute) {
}
ngOnInit() {
this.activeRoute.params.subscribe(routeParams => {
this.parameterIdfiches = routeParams['idfiches'];
});
}
有人可以帮我知道我在这里缺少什么吗?先谢谢各位了^^
【问题讨论】:
标签: angular typescript iframe