linsx

ngOnDestroy

在指令被销毁前,将会调用 ngOnDestory 方法。它主要用于执行一些清理操作,比如:移除事件监听、清除定时器、退订 Observable 等。

 

调用方法

1.

import { Component , OnInit, OnDestroy} from \'@angular/core\';

2.
export class ExamDetailComponent implements OnInit, OnDestroy {}

3.

    ngOnDestroy() {
        clearInterval(this.allTimeCount);
    }

 

分类:

技术点:

相关文章:

  • 2021-12-31
  • 2021-12-31
  • 2021-12-31
  • 2021-12-31
  • 2021-12-31
  • 2021-12-31
  • 2021-12-31
  • 2021-12-31
猜你喜欢
  • 2021-12-31
  • 2021-12-31
  • 2021-12-31
  • 2022-12-23
  • 2021-12-31
  • 2021-12-31
相关资源
相似解决方案