<commit_before>
import {Component} from '@angular/core';
import {Event_editService} from './event_edit.service';

// We `import` `http` into our `Event_editService` but we can only
// specify providers within our component
import {HTTP_PROVIDERS} from '@angular/http';

// Import NgFor directive
import {NgFor} from '@angular/common';

import {Subscription } from 'rxjs';

import {RouteConfig, Router} from '@angular/router-deprecated';

// Create metadata with the `@Component` decorator
@Component({
    // HTML tag for specifying this component
    selector: 'event_edit',
    // Let Angular 2 know about `Http` and `Event_editService`
    providers: [...HTTP_PROVIDERS, Event_editService],
    template: require('./event_edit.html')
})
export class Event_edit {

  // Initialize our `event_editData.text` to an empty `string`
  event_editData = {
    title: "",
    date: "",
    place: "",
    tags: [],
    description: "",
    guest: [],
    shoppingList: []
  };
  private subscription: Subscription;

  private event_edits: Array<Event_edit> = [];
  private router : Router;

  selectedId;
  constructor(public event_editService: Event_editService,_router: Router) {
    console.log('Event_edit constructor go!');
    this.router = _router;
     //let id = +this.route.snapshot.params['id'];
      //this.event_edits = [];
      event_editService.getOne("5823194d408d2da5e30163cd")
        // `Rxjs`; we subscribe to the response
        .subscribe((res) => {

            // Populate our `event_edit` array with the `response` data
            this.event_editData = res;

        });
  }


  deleteShoppingListEllement(ellement){
    // loop through all of the `directions` in the `selectedRecipe`
    for (let i = 0; i <  this.event_editData.shoppingList.length; i++) {
      // if the `direction` at the current index matches that of the one
      // the user is trying to delete
      if (this.event_editData.shoppingList[i] === ellement) {
        // delete the `direction` at the current index
        this.event_editData.shoppingList.splice(i, 1);
      }
    }
  }

  // Whenever the user needs to add a new `direction`, push an
  // empty `direction` object to the `direction` array on the
  // `selectedRecipe`
  newShoppingListEllement() {

    // blank `direction` object
    let direction = {<commit_msg>it works now<commit_after>
import {Component} from '@angular/core';
import {Event_editService} from './event_edit.service';

// We `import` `http` into our `Event_editService` but we can only
// specify providers within our component
import {HTTP_PROVIDERS} from '@angular/http';

// Import NgFor directive
import {NgFor} from '@angular/common';

import {Subscription } from 'rxjs';

import {RouteConfig, Router,RouteParams} from '@angular/router-deprecated';

import {RouterActive} from '.././shared/directives/router-active/router-active.directive';

// Create metadata with the `@Component` decorator
@Component({
    // HTML tag for specifying this component
    selector: 'event_edit',
    // Let Angular 2 know about `Http` and `Event_editService`
    directives:[RouterActive],
    providers: [...HTTP_PROVIDERS, Event_editService],
    template: require('./event_edit.html')
})
export class Event_edit {

  // Initialize our `event_editData.text` to an empty `string`
  event_editData = {
    title: "",
    date: "",
    place: "",
    tags: [],
    description: "",
    guest: [],
    shoppingList: []
  };
  private subscription: Subscription;

  private event_edits: Array<Event_edit> = [];
  private router : Router;

  selectedId;
  constructor(public event_editService: Event_editService,_router: Router,private params:RouteParams) {
    console.log('Event_edit constructor go!');
    this.router = _router;
     //let id = +this.route.snapshot.params['id'];
      //this.event_edits = [];
      event_editService.getOne(params.get('id'))
        // `Rxjs`; we subscribe to the response
        .subscribe((res) => {

            // Populate our `event_edit` array with the `response` data
            this.event_editData = res;

        });
  }


  deleteShoppingListEllement(ellement){
    // loop through all of the `directions` in the `selectedRecipe`
    for (let i = 0; i <  this.event_editData.shoppingList.length; i++) {
      // if the `direction` at the current index matches that of the one
      // the user is trying to delete
      if (this.event_editData.shoppingList[i] === ellement) {
        // delete the `direction` at the current index
        this.event_editData.shoppingList.splice(i, 1);
      }
    }
  }

  // Whenever the user needs to add a new `direction`, push an
  // empty `direction` object to the `direction` array on the
  // `selectedRecipe`
  newShoppingListEllement() {

    // blank `direction` object
    let direction = {
{'fraction_non_alphanumeric': 0.12492192379762648, 'fraction_numerical': 0.004788673745575682, 'mean_word_length': 3.236331569664903, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6877153', 'n_tokens_mistral': 1450, 'n_tokens_neox': 1429, 'n_words': 418}