import { Component, OnInit } from '@angular/core'; import { interval } from 'rxjs'; @Component({ selector: 'app-child', templateUrl: './child.component.html', styleUrls: ['./child.component.scss'] }) export class ChildComponent implements OnInit { src = interval(2000); id = Date.now(); constructor() { } ngOnInit(): void { console.log('Az alkalmazás indul' + this.id) this.src.subscribe(() => { console.log('Érkezett: ' + this.id) }) } ngOnDestroy() { console.log('Komponens vége' + this.id); } }