Friday, 10 May 2019

inherit two component in angular with different constructor

Please watch the EDIT :

I have a component 1 using service1, and component 2 using service2.

I would like to make a child component, that extends component 1 and component 2

I have followed the mixin example, but I do not know if it is possible with different constructors :

here is StackBlitz

I would like to be able to call both functions:

  ngOnInit() {
    this.sayHey2();
    this.sayHey1();
  }

in my child component, and have booth property of booth parent component.

is it possible?

** EDIT:**

My case is slightly different and follows this Stackblitz

here is a schema of why I want to do this https://prnt.sc/nlcxnd (hope it's comprehensible)

I want to actually make a component, that merges a component, and a class together.



from inherit two component in angular with different constructor

No comments:

Post a Comment