<commit_before>import {Control, FORM_DIRECTIVES} from '@angular/common';
import {Component, Output, Input, EventEmitter} from '@angular/core';
import {Todo} from '../common/todo.model';
import {AddTodoComponent} from './addtodo.component'
import {Observable} from 'rxjs/Rx';
import {EditTodoComponent} from './todoEdit.component'

@Component({
	selector: 'todo-search',
	directives: [FORM_DIRECTIVES, EditTodoComponent, AddTodoComponent],
	template: `
	<input [ngFormControl]="skipBox" placeholder="SKIP" [(ngModel)]='skip' />
  <input [ngFormControl]="takeBox" placeholder="TAKE" [(ngModel)]='take' />
	<ul class="list-group">
    <li (click)="onSelect(todo)" *ngFor="let todo of todos" class="list-group-item" [ngClass]= "{foo : todo.status === 'Completed'}">
      <span>{{todo.note}} </span>
      <span class="label label-default label-pill pull-xs-right">{{todo.status}} </span>
      <span class="label label-default label-pill pull-xs-right">{{todo.created}} </span>
      <span class="label label-default label-pill pull-xs-right">{{todo.priority}}</span>
    </li>
  </ul>
	<hr>
	<todo-edit (doneEvent)="onEditDone($event)" *ngIf="selectedTodo" [todo]="selectedTodo"></todo-edit>
	`
})
export class TodoSearchComponent {
  private skipBox: Control = new Control();
  private takeBox: Control = new Control();
	private skip: number = 0;
	private take: number = 10;

  @Input() todos: Todo[];
  @Output() searchEvent: EventEmitter<any> = new EventEmitter();

	selectedTodo: Todo;

	constructor() {
		this.skipBox.valueChanges.startWith(this.skip)
			.combineLatest(this.takeBox.valueChanges.startWith(this.take), (skip, take) => ({ skip, take }))
			.subscribe(x => {
				console.log('search event');
				this.searchEvent.emit(x);
			})
  }

	onEditDone(foo: any) {
		this.selectedTodo = undefined;
	}

	onSelect(todo: Todo) {
		this.selectedTodo = todo;
	}
}<commit_msg>log clear out<commit_after>import {Control, FORM_DIRECTIVES} from '@angular/common';
import {Component, Output, Input, EventEmitter} from '@angular/core';
import {Todo} from '../common/todo.model';
import {AddTodoComponent} from './addtodo.component'
import {Observable} from 'rxjs/Rx';
import {EditTodoComponent} from './todoEdit.component'

@Component({
	selector: 'todo-search',
	directives: [FORM_DIRECTIVES, EditTodoComponent, AddTodoComponent],
	template: `
	<input [ngFormControl]="skipBox" placeholder="SKIP" [(ngModel)]='skip' />
  <input [ngFormControl]="takeBox" placeholder="TAKE" [(ngModel)]='take' />
	<ul class="list-group">
    <li (click)="onSelect(todo)" *ngFor="let todo of todos" class="list-group-item" [ngClass]= "{foo : todo.status === 'Completed'}">
      <span>{{todo.note}} </span>
      <span class="label label-default label-pill pull-xs-right">{{todo.status}} </span>
      <span class="label label-default label-pill pull-xs-right">{{todo.created}} </span>
      <span class="label label-default label-pill pull-xs-right">{{todo.priority}}</span>
    </li>
  </ul>
	<hr>
	<todo-edit (doneEvent)="onEditDone($event)" *ngIf="selectedTodo" [todo]="selectedTodo"></todo-edit>
	`
})
export class TodoSearchComponent {
  private skipBox: Control = new Control();
  private takeBox: Control = new Control();
	private skip: number = 0;
	private take: number = 10;

  @Input() todos: Todo[];
  @Output() searchEvent: EventEmitter<any> = new EventEmitter();

	selectedTodo: Todo;

	constructor() {
		this.skipBox.valueChanges.startWith(this.skip)
			.combineLatest(this.takeBox.valueChanges.startWith(this.take), (skip, take) => ({ skip, take }))
			.subscribe(x => this.searchEvent.emit(x))
  }

	onEditDone(foo: any) {
		this.selectedTodo = undefined;
	}

	onSelect(todo: Todo) {
		this.selectedTodo = todo;
	}
}
{'fraction_non_alphanumeric': 0.17963910584433074, 'fraction_numerical': 0.0016159439806086723, 'mean_word_length': 5.0785597381342065, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 43, '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': '2208457', 'n_tokens_mistral': 1312, 'n_tokens_neox': 1272, 'n_words': 266}