I have two component A and B.
and A have a public function which is ‘function_A()’.
how do I call it form B without making it to a static function??
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A component instance is basically an object. So you should always let components interact with each other how the various OOP paradigms suggest objects should interact.
As for view components: avoid as much interaction as possible and try to implement your application via MV* (MVC, MVP, MVVM, …) pattern. This appears to be more complicated at first. But these design approaches scale with the size and live span of a project. Letting objects know and do too much, not.