Tightening rules on code length
This commit is contained in:
		@@ -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({
 | 
			
		||||
 
 | 
			
		||||
@@ -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>
 | 
			
		||||
 
 | 
			
		||||
@@ -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) { }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user