How is the relationship between a component controller class and the component is formed. Is it simply based on the positioning that whatever class comes after a given component, it becomes the component controller class for the component defined before it. How does it works if you have multiple components in a single js file. How do you associate a class anywhere in the js file to a component.
Along the same lines, is there such a thing as child components and in that case do these child components inherit something from parent components and more specifically from the component controller class of parent component.
How is the relationship between a component controller class and the component is formed. Is it simply based on the positioning that whatever class comes after a given component, it becomes the component controller class for the component defined before it.
Yes.
How does it works if you have multiple components in a single js file
Have the structure:
@Component ...
class Foo ...
@Component ...
class Bar ...
Is there such a thing as child components and in that case do these child components inherit something from parent components and more specifically from the component controller class of parent component.
Components don't inherit. Components compose. Search inheritance vs. composition (but I sure you know this).
Also see : https://github.com/Microsoft/TypeScript/issues/2249
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With