Topics for this chapter:
- Inheritance In Aura Component
Similar to all other modern framework and programming languages, the Lightning framework also supports Inheritance. Using inheritance is one way to share the common code between multiple components.
Inheritance in Lightning allows you to inherit parent component’s attributes, body attributes, events, helper and client-side controller.
In the above code, the Base component is an aura component which needs to be inherited by CarSearchForm component.
1. To make a component available for inheritance, you need to declare the abstract property to true.
2. In helper file, I have defined a few methods which will be called from CarSearchForm helper file.
3. To extend the Base component in CarSearchForm component, you need to extend it in the component.
4. In helper file, you can call Base component’s helper method simply referring them as helper.methodName().
Lightning Component Development Day5 - Server Side Controller, Apex, Inheritance In Lightning
Inheritance In Aura Component