<commit_before>import {Component, OnInit} from '@angular/core';
import {Tasks} from "../tasks";
import {TodoService} from "../todo.service";

@Component({
  moduleId: module.id,
  selector: 'todo-list',
  templateUrl: 'todo.component.html'
})

export class TodoComponent implements OnInit {
  name = 'TODO List';
  tasks: Tasks[];

  constructor(private todoService: TodoService) {}

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

  getTasks(): void {
     this.tasks = this.todoService.getTodoList();
  }
}<commit_msg>todo component changes<commit_after>import {Component, OnInit, OnDestroy} from '@angular/core';
import {Tasks} from "../tasks";
import {TodoService} from "../todo.service";

@Component({
  moduleId: module.id,
  selector: 'todo-list',
  templateUrl: 'todo.component.html'
})

export class TodoComponent implements OnInit, OnDestroy {
  name = 'TODO List';
  tasks: Tasks[];

  constructor(private todoService: TodoService) {}

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

  ngOnDestroy(): void {
    this.saveTasks();
  }

  getTasks(): void {
     this.tasks = this.todoService.getTodoList();
  }

  saveTasks(): void {
    this.todoService.saveItems(this.tasks);
  }
}
{'fraction_non_alphanumeric': 0.15590947191953058, 'fraction_numerical': 0.0, 'mean_word_length': 4.037974683544304, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6250444', 'n_tokens_mistral': 401, 'n_tokens_neox': 393, 'n_words': 90}