0

So here is my parent lightning component controller method...

doInit({
 getParameter : function(component, name) {
    return (window.location.search.match(new RegExp('[?&]' + name + '=([^&]+)')) || [, null])[1];
}})

Now I want to call this method in a component controller, which is extending it.

The extending Component:

<aura:component implements="forceCommunity:availableForAllPageTypes" extends="c:Parent" access="global">

The extending Component Controller:

({
doInit : function(component, event, helper) {
    var param = c.getParameter(component, 'abc'); // This is where I think I'm wrong.
}})
1

lets say you have a helper method getParameter in the abstract component from the child component which is extending it you should do

this.getParameter();

from the child component's helper. you can't access the abstract components controller methods but you can access the helper methods.

Read here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.