我正在寻找用不同的用户登录页面创建一个Angular 2应用程序,例如'user1.example-domain.com'和'user2.example-domain.com'将会有不同和无关的'主页'。如何在angular2中使用子域进行路由?
我的问题:
- 它采用了棱角分明2怎么能怎么办?
- 如何在本地机器上测试它?是“user1.localhost:port”够了吗?
我使用静态路由,像这样尝试:
{path: 'test.localhost:4200/generic-link1', component: GenericLink1Component}
我已经看到了它的不倒翁做我知道,这是可以做到。
[Html5 History Api - pushState from a domain to subdomain]可能的副本(http://stackoverflow.com/questions/14807921/html5-history-api-pushstate-from-a-domain-toa-a-子域名) – estus
Angular app是SPA,Angular路由器使用pushState根据路径更改网址。无论你看到什么,你都看到了与此不同的东西。 – estus
只是为了澄清,我没有看到它在角度2(不知道tumblr的开发方法)中完成。我知道这个概念存在:http://skittenthekitten.tumblr.com/你可以看到特定用户“user.tumblr.com”的子域名的使用(我没有宣传他是谁:)) – Hahn