Showing and hiding the button on clicking of a button in Salesforce Lightning

Baisc.cmp
<aura:component>
    <lightning:button label="Toggle" onclick="{!c.toggle}"/>
    <ui:button label="Submit" aura:id="button"/>
</aura:component>

controller
----------

({
    toggle : function(component, event, helper) {
        var toggleText = component.find("button");
        $A.util.toggleClass(toggleText, "toggle");
    }
})


Style
------
.THIS.toggle {
    display: none;
}


Lightning Application
----------------------
<aura:application extends="force:slds" >
    <c:Basic/>
</aura:application>

Comments