+ Start a Discussion
Avinash AAvinash A 

hi, I am trying to print a toast message in lightning component ,but i am getting an error, Please help me resolving this issue

<!-- this is the component -->
<lightning:button label="Success" onclick="{!c.handleClick}"/>


//Client side JS


 handleClick : function(component, event, helper) {        
        var toastEvent = $A.get("e.force:showToast");
        toastEvent.setParams({
            "title": "The toast pops up",
            "message": "Toast event fired",
            "mode": "sticky",
            "type": "other",
        });
        toastEvent.fire();
    }

 
Avinash AAvinash A
This is the error message im getting
Paul Grice 20Paul Grice 20
You don't need a comma after the final parameter in the .setParams( { } ); Have you tried it without?