简体   繁体   English

新窗口中的角度打开组件无需自举

[英]Angular open component in new window without bootstraping

I would like to open a component in a new window but without to bootstrap again. 我想在新窗口中打开组件,但无需再次引导。 In my case I am using a popup from devextreme, but I would like to open and hide a window like I would do it with a popup or dialog. 就我而言,我使用的是来自devextreme的弹出窗口,但我想像使用弹出窗口或对话框那样打开和隐藏窗口。 The benefit of a window is that it can be used outside and parallel. 窗口的好处是它可以在外部和并行使用。 But the first time the window reopens ot is to slow. 但是第一次重新打开窗口的速度很慢。

Opening a new window for an angular application actually breaks the Single Page Application philosophy. 为有角度的应用程序打开一个新窗口实际上打破了单页应用程序的哲学。 However, there can be a usecase to open a component in different window. 但是,可能会有一个用例在不同的窗口中打开组件。

One way is to use sessions . 一种方法是使用会话 Sessions are something which are maintained throughout the browser. 会话是在整个浏览器中维护的东西。 So when you, say click a button, you can store a variable in session. 因此,当您说单击按钮时,可以在会话中存储变量。 Now when the new window is opened, use the session variable you stored to create a logic of routing to your component. 现在,当打开新窗口时,使用存储的会话变量创建路由到组件的逻辑。

Bootstrapping of application is still there, but it loads your component. 应用程序的引导程序仍然存在,但是会加载您的组件。 I am not sure if this can be done without bootstrapping. 我不确定如果没有引导程序是否可以完成此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM