[SalesForce] Passing Parameter Value to the Apx(server-side controller) in lightning

I am very new in Lightning App Development. I am getting an error this error(Uncaught error in $A.run() : component is not defined) When i want to pass the component value to the Apex(Server-Side Controller) in lightning using JS(Client-Side Controller).

Here is my Code for my Code

COMPONENT
enter image description here

CLIENT SIDE
enter image description here

SERVER SIDE CONTROLLERenter image description here

Best Answer

One problem is that in your button, the press attribute shouldn't be written as a merge field.

<ui:button label="Go" press="c.search" />

You also have a misspelling in your client-side controller. It should be:

search : function(component, event, helper){ 

You might be getting the message "component is not defined" because the variable was named "componet"

Also, you could also simplify you server-side controller if you wanted: (unrelated to the error)

public class CheckinCntrlr{
    @AuraEnabled
    public static String checkfoundevent(String ticketid1){
        Ticket__c obj = [
            SELECT Event_Product__r.Event__c.Name 
            FROM Ticket__c
            WHERE Id = :ticketid1
        ];
        return obj.Event_Product__r.Event__c.Name;
    }
}