<commit_before>import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router'
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { TubularDataService } from '@tubular2/tubular2';

@Component({
    selector: 'login',
    template: `<form [formGroup]="loginForm" (ngSubmit)="onSubmit(loginForm)">
                    <div class="row">
                        <div class="col-md-4 col-md-push-4">
                            <div class="form-group">
                                <label>User:</label>
                                <input class="form-control" type="text" formControlName="username"/>
                                <label>Password:</label>
                                <input class="form-control" type="password" formControlName="password"/>
                             </div>
                            <div class="form-group">
                                <button type="submit" class="btn btn-sm btn-success btn-block" [disabled]="loginForm.invalid">Login</button>
                            </div>
                            <span class="form-group" *ngIf=""></span>
                        </div>
                    </div>
              </form>`
})

export class LoginComponent implements OnInit {
    loginForm: FormGroup;

    constructor(private fb: FormBuilder, private dataService: TubularDataService, private router: Router) { }

    ngOnInit() {
        this.loginForm = this.fb.group({
            username: ['', Validators.required],
            password: ['', Validators.required]
        });
    }

    onSubmit(data) {
        let username = data.value.username;
        let password = data.value.password;
        this.dataService.authenticate('http://tubular.azurewebsites.net/token', username, password,
            () => {
                this.router.navigate(['/grid']);
            }, (error) => {
                let resul = this.dataService.isAuthenticated();
                let err = JSON.parse(error._body);
                alert(error.statusText + '! , ' + err.error_description);
                this.router.navigate(['/login']);
        }, true);      
    }
}<commit_msg>delete unnecessary line<commit_after>import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router'
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { TubularDataService } from '@tubular2/tubular2';

@Component({
    selector: 'login',
    template: `<form [formGroup]="loginForm" (ngSubmit)="onSubmit(loginForm)">
                    <div class="row">
                        <div class="col-md-4 col-md-push-4">
                            <div class="form-group">
                                <label>User:</label>
                                <input class="form-control" type="text" formControlName="username"/>
                                <label>Password:</label>
                                <input class="form-control" type="password" formControlName="password"/>
                             </div>
                            <div class="form-group">
                                <button type="submit" class="btn btn-sm btn-success btn-block" [disabled]="loginForm.invalid">Login</button>
                            </div>
                            <span class="form-group" *ngIf=""></span>
                        </div>
                    </div>
              </form>`
})

export class LoginComponent implements OnInit {
    loginForm: FormGroup;

    constructor(private fb: FormBuilder, private dataService: TubularDataService, private router: Router) { }

    ngOnInit() {
        this.loginForm = this.fb.group({
            username: ['', Validators.required],
            password: ['', Validators.required]
        });
    }

    onSubmit(data) {
        let username = data.value.username;
        let password = data.value.password;
        this.dataService.authenticate('http://tubular.azurewebsites.net/token', username, password,
            () => {
                this.router.navigate(['/grid']);
            }, (error) => {
                let err = JSON.parse(error._body);
                alert(error.statusText + '! , ' + err.error_description);
                this.router.navigate(['/login']);
        }, true);      
    }
}
{'fraction_non_alphanumeric': 0.13670064874884152, 'fraction_numerical': 0.0018535681186283596, 'mean_word_length': 1.663170882171499, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '253811', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1079, 'n_words': 209}