SES-75 added router into sign-in page
This commit is contained in:
parent
8ccdcb955e
commit
2d152df1b1
@ -1,5 +1,6 @@
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { SelectRoleComponent } from './app/components/select-role/select-role.component';
|
||||
import { SignInComponent } from './app/components/sign-in/sign-in.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
@ -7,6 +8,11 @@ const routes: Routes = [
|
||||
component: SelectRoleComponent,
|
||||
pathMatch: 'full'
|
||||
},
|
||||
{
|
||||
path: 'login',
|
||||
component: SignInComponent,
|
||||
pathMatch: 'full'
|
||||
},
|
||||
];
|
||||
|
||||
export const appRoutingModule = RouterModule.forRoot(routes);
|
||||
|
@ -8,11 +8,13 @@ import { appRoutingModule } from '../app.routing';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { SignInComponent } from './components/sign-in/sign-in.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent,
|
||||
SelectRoleComponent,
|
||||
SignInComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }),
|
||||
|
@ -1,4 +1,4 @@
|
||||
<div class="container font">
|
||||
<button id="player-button" class="button font">Player</button>
|
||||
<button id="game-master-button" class="button font">Game Master</button>
|
||||
<button (click)="SignInWithRole()" id="player-button" class="button font">Player</button>
|
||||
<button (click)="SignInWithRole()" id="game-master-button" class="button font">Game Master</button>
|
||||
</div>
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { SignInComponent } from './../sign-in/sign-in.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-select-role',
|
||||
@ -8,10 +10,16 @@ import { Component } from '@angular/core';
|
||||
export class SelectRoleComponent {
|
||||
isExpanded = false;
|
||||
|
||||
constructor(private router: Router) {}
|
||||
|
||||
collapse() {
|
||||
this.isExpanded = false;
|
||||
}
|
||||
|
||||
SignInWithRole() {
|
||||
this.router.navigate(['login'])
|
||||
}
|
||||
|
||||
toggle() {
|
||||
this.isExpanded = !this.isExpanded;
|
||||
}
|
||||
|
@ -0,0 +1 @@
|
||||
<p>Sign in</p>
|
19
SessionCompanion/SessionCompanion/package-lock.json
generated
Normal file
19
SessionCompanion/SessionCompanion/package-lock.json
generated
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"requires": true,
|
||||
"lockfileVersion": 1,
|
||||
"dependencies": {
|
||||
"@ngrx/store": {
|
||||
"version": "10.1.0",
|
||||
"resolved": "https://artifactory.platform.vwfs.io/artifactory/api/npm/vwfs-du-cp-npm-virtual/@ngrx/store/-/store-10.1.0.tgz",
|
||||
"integrity": "sha1-N5qjhUP//T5ByoYiQ0oXH+cO1vg=",
|
||||
"requires": {
|
||||
"tslib": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"tslib": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://artifactory.platform.vwfs.io/artifactory/api/npm/vwfs-du-cp-npm-virtual/tslib/-/tslib-2.0.3.tgz",
|
||||
"integrity": "sha1-jgdBrEX8DCJuWKF7/D5kubxsphw="
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user