I have a landing page in which the user (by default) and the "Register" component will be presented, which is a set of input fields that allow them to register.
For returning users, I would like them to see the landing page as it is, then click on "Login" and simply replace the registration component with the login component. I do not want the URL to change, it should remain '/'.
For ui-router, I could execute nested states, but not sure if Angular2 still supports the router?
app.ts
@Component({ selector: 'app', template: ' *snip* <router-outlet></router-outlet> *snip* ', directives: [Footer, ROUTER_DIRECTIVES] }) @RouteConfig([ { path: '/...', name: 'Landing', component: LandingComponent, useAsDefault: true }, { path: '/about', name 'About', component: AboutComponent } ]);
landing.ts
@Component({ selector: 'landing', template: ' <body> <div> <router-outlet></router-outlet> </div> </body>', directives: [ROUTER_DIRECTIVES] }) @RouteConfig([ { path: '/', name: 'RegisterForm', component: RegisterForm, useAsDefault: true }, { path: '/login', name: 'LoginForm', component: LoginForm }, ])
Should the different paths for the landing component be different?