Angular component is not released in page navigation on Chrome Dev Tool

Viewed 135

I created fresh Angular 11 project and then added two pages with only one div covering the whole page as followings:

// pour page

// component.html
<div style="width: 100vw; height: 100vh; background: cyan;" (click)="onClick()"></div>
// component.ts
@Component({
  selector: 'app-pour-page',
  templateUrl: './pour-page.component.html',
  styleUrls: ['./pour-page.component.scss']
})
export class PourPageComponent implements OnInit {

  constructor(private router: Router) { }

  ngOnInit(): void {
  }

  onClick() {
    this.router.navigateByUrl('selector');
  }
}

// selector page

// component.html
<div style="width: 100vw; height: 100vh; background: yellow;" (click)="onClick()"></div>
// component.ts
@Component({
  selector: 'app-selector',
  templateUrl: './selector.component.html',
  styleUrls: ['./selector.component.scss']
})
export class SelectorComponent implements OnInit {

  constructor(private router: Router) { }

  ngOnInit(): void {
  }

  onClick() {
    this.router.navigateByUrl('pour-page');
  }
}

I tried to check memory snapshot on chrome dev tool but it is showing different results in inspector mode and non-inspector mode.

enter image description here

enter image description here

As you can see in above screenshots, in inspector mode(which has touch enabled), it is showing memory leaks while it is not in non-inspector mode.

Is this known bug in inspector mode? I really couldn't figure out what's wrong with it.

0 Answers
Related