<commit_before>import { Component, OnInit } from '@angular/core';
import { Hero } from './hero';
import { HeroService } from './hero.service';

import { Router } from '@angular/router';

@Component({
  moduleId: module.id,
  selector: 'my-heroes',
  // @NOTE see [(ngModel)] section of template for two-way binding syntax
  templateUrl: './heroes.component.html',
  // embedded styling for this component 
  // @TODO explore how to make this global to the project somehow
  styleUrls: ['./heroes.component.css'],
  //providers: [HeroService]
})

export class HeroesComponent implements OnInit {
  // type of heroes property is inferred from HEROES const (array of Hero class instances)
  // the `:` notation refers to unitialized properties
  heroes: Hero[];
  // explicitly declared type of `selectedHero` property (Hero class)
  // `selectedHero` is property for storing the selected hero passed through the binding function
  selectedHero: Hero;
  // teach the component about the HeroService
  constructor(
    private router: Router,
    private heroService: HeroService
  ) { };

  ngOnInit(): void {
    this.getHeroes();
  };

  add(name: string): void {
    name = name.trim()
    if (!name) { return; }
    this.heroService.create(name)
      .then(hero => {
        this.heroes.push(hero);
        this.selectedHero = null;
      });
  }

  delete(hero: Hero): void {
    this.heroService
      .delete(hero.id)
      .then(() => {
        this.heroes = this.heroes.filer(h => h !== hero);
        if (this.selectedHero === hero) { this.selectedHero = null; }
      });
  }

  getHeroes(): void {
    //this.heroService.getHeroesSlowly().then(heroes => this.heroes = heroes);
    this.heroService.getHeroes().then(heroes => this.heroes = heroes);
  };<commit_msg>Nothing to see here. Just updating...<commit_after>import { Component, OnInit } from '@angular/core';
import { Hero } from './hero';
import { HeroService } from './hero.service';

import { Router } from '@angular/router';

@Component({
  moduleId: module.id,
  selector: 'my-heroes',
  // @NOTE see [(ngModel)] section of template for two-way binding syntax
  templateUrl: './heroes.component.html',
  // embedded styling for this component 
  // @TODO explore how to make this global to the project somehow
  styleUrls: ['./heroes.component.css'],
  //providers: [HeroService]
})

export class HeroesComponent implements OnInit {
  // type of heroes property is inferred from HEROES const (array of Hero class instances)
  // the `:` notation refers to unitialized properties
  heroes: Hero[];
  // explicitly declared type of `selectedHero` property (Hero class)
  // `selectedHero` is property for storing the selected hero passed through the binding function
  selectedHero: Hero;
  // teach the component about the HeroService
  constructor(
    private router: Router,
    private heroService: HeroService
  ) { };

  ngOnInit(): void {
    this.getHeroes();
  };

  add(name: string): void {
    name = name.trim()
    if (!name) { return; }
    this.heroService.create(name)
      .then(hero => {
        this.heroes.push(hero);
        this.selectedHero = null;
      });
  }

  delete(hero: Hero): void {
    this.heroService
      .delete(hero.id)
      .then(() => {
        this.heroes = this.heroes.filter(h => h !== hero);
        if (this.selectedHero === hero) { this.selectedHero = null; }
      });
  }

  getHeroes(): void {
    //this.heroService.getHeroesSlowly().then(heroes => this.heroes = heroes);
    this.heroService.getHeroes().then(heroes => this.heroes = heroes);
  };
{'fraction_non_alphanumeric': 0.13546039742513294, 'fraction_numerical': 0.0, 'mean_word_length': 3.155813953488372, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '6576376', 'n_tokens_mistral': 1092, 'n_tokens_neox': 1076, 'n_words': 317}