Tightening rules on code length

This commit is contained in:
Zakary Timson 2019-08-25 10:42:33 -04:00
parent 9f6a866b16
commit 9316e9a599
3 changed files with 4 additions and 4 deletions

View File

@ -4,8 +4,8 @@ import {MapComponent} from "./views/map/map.component";
import {HomeComponent} from "./views/home/home.component";
const routes: Routes = [
{path: '', pathMatch: 'full', component: HomeComponent},
{path: '**', component: MapComponent}
{path: ':id', component: MapComponent},
{path: '**', pathMatch: 'full', component: HomeComponent},
];
@NgModule({

View File

@ -10,7 +10,7 @@
<form class="input-group">
<input type="text" class="form-control" [(ngModel)]="code" name="code" placeholder="Code">
<div class="input-group-append">
<button class="btn btn-danger" [routerLink]="['/', code]" style="background-color: #dd0330" [disabled]="code">Open</button>
<button class="btn btn-danger" [routerLink]="['/', code]" style="background-color: #dd0330" [disabled]="code.length != 8">Open</button>
</div>
</form>
</div>

View File

@ -10,7 +10,7 @@ const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
styleUrls: ['home.component.scss']
})
export class HomeComponent {
code: string;
code: string = '';
constructor(private syncService: SyncService, private router: Router) { }