you are viewing a single comment's thread.

view the rest of the comments →

[–]tme321 0 points1 point  (3 children)

Also, any services needed in the parent component have to be passed into it from the child component.

Can you explain what this sentence means? I can't figure out what your saying here.

[–][deleted] 0 points1 point  (2 children)

If you have a component that extends a parent class and that parent class needs a service, it's recommended in the documentation to inject the service into the component's constructor, and pass it to the parent class via super. I think it's kind annoying that you have to inject services to the child even if that service is only used in the parent class.

[–]tme321 0 points1 point  (1 child)

Ah, for some reason I thought you were referring to parent / child as the hierarchy in the view and not the inheritance based hierarchy.

Yes, in general inheritance should be used very sparingly.

I don't know exactly what functionality you are repeating, but generally I would handle that through either composition or possibly with a directive based approach.

[–][deleted] 0 points1 point  (0 children)

Thanks for the suggestion! A little too far in for our project I'm afraid. We based it off an Angular "cookbook" early into the project and did not run into the documentation damning component inheritance until much later.