我刚开始使用Angular2,发现在网上可以找到的所有教程仅说明了如何为单页应用程序(SPA)设置Angular2.
I have just started out with Angular2 and found out that all tutorials that can be found on the web only explains how to setup Angular2 for Single Page Apps (SPA).
但是,对于我网站的主页,我仍然想使用PHP,而只是在诸如Login/Signup/Contact之类的一些地方使用Angular2.
However for the homepage of my site I still want to use PHP and just use Angular2 on a few places like Login/Signup/Contact, etc.
如何在联系人页面上初始化联系人组件,在登录页面上初始化登录组件,等等?
How is that possible to initialize the Contact Component on the contact page, Login Component on the login page, etc?
我不希望它们一次全部加载,只是一个简单的组件即可处理登录,注册等功能.
I don't want all of them to load at once, just a simple component that handles the logging in, signing up, etc functions.
我相信在Bootstrapping部分需要做些什么,但是究竟是什么?
I beleive something need to be done on the Bootstrapping part, but what exactly?
编辑:我也可能要在一页上使用登录+注册"组件.
I also might want to use the Login + Signup componenents on one page.
推荐答案我认为您可以引导该页面上所需的任何组件
I think you could bootstrap whatever component you need on that page
import {bootstrap} from '@angular/platform-browser-dynamic'; import {ContactComponent} from './contactponent'; bootstrap(ContactComponent);更多推荐
如何将Angular2用作非SPA?
发布评论