Activity Forums Salesforce® Discussions What is doInit in lightning component?

  • Yogesh

    Member
    August 9, 2019 at 2:56 pm

    This event is automatically fired when an app or component is initialized, prior to rendering.

    Component-

    <aura:component>

    <aura:handler name=”init” value=”{!this}” action=”{!c.doInit}”/>

    </aura:component>

    jsController-

    ({
    doInit: function(cmp) {
    // Set the attribute value.
    // You could also fire an event here instead.
    alert(‘test’);
    }
    })

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos