How to introduce hook like custom life cycle event in angular

Viewed 167

We need to introduce some life cycle event like onRest() and we need to fire that onRest() event from the parent component. And any other components which use that hook should fire onRest() method when it is called from parent exactly like life cycle hook.

Simply I want to introduce that kind of custom life cycle hook and call it from the main parent module or something like that. It really helps if anybody has an idea to introduce that kind of custom life cycle hook and way of calling it.

MyComponents implements onReset() {
   
  onRest() {
   clearAll(...);
  }

}

I know that we can introduce parent component and implement it here. But I need different kinds of thing like lifecycle hook that can call from other modules and all related thing should fire.

0 Answers
Related