+ Start a Discussion
Mohith Kumar ShrivastavaMohith Kumar Shrivastava 

TrialHead Lightning Challenge evaluating wrong

I am attempting challenge in trialhead 

https://developer.salesforce.com/trailhead/lightning_components/lightning_components_events_handle

I am gettting below error 

User-added image

I checked my code and I have tags properly written as below
 
<aura:component >
    <aura:registerEvent name="phevent" type="mohrcks:PhoneNumberEvent"/>
    <ui:inputPhone aura:id="phone" label="phone" />
    <ui:button label="Show Phone" press="{!c.send}"/>
</aura:component>
Also for output I have handler defined as well
 
<aura:component >
    <aura:attribute name="number" type="String" default="No Phone Number"/>
    <ui:outputText aura:id="phone" value="{!v.number}"/>
    <aura:handler event="mohrcks:PhoneNumberEvent" action="{!c.answer}"/>
</aura:component>

My events that is created is as follows
 
<aura:event type="APPLICATION" description="Event template">
    <aura:attribute name="phone" type="String"/>
</aura:event>

My handler ctrl class for input is as below
({
	send : function(component, event, helper) {
		var phone = component.find("phone").get("v.value");
        console.log(phone);
        $A.get("event.mohrcks:PhoneNumberEvent").setParams({
            phone: phone
       }).fire();
	}
})

For output My handler class is 
 
({
	answer : function(component, event, helper) {
		var text = event.getParam("phone");
        component.set("v.number", text);
	}
})

I am able to see this working in my org ,I still get the issue as seen below

User-added image

Is this is a bug in Trailhead ?


 
Best Answer chosen by Mohith Kumar Shrivastava
Mohith Kumar ShrivastavaMohith Kumar Shrivastava
Trying this with new developer ORG without namespace fixed this issue automatically .

All Answers

Sandeep BhanotSandeep Bhanot
Mohit - can you please double-check that you haven't mixed up the code for the PhoneNumberInput and PhoneNumberOutput components? Without giving away the answer ( :) ), remember that the registerEvent handler needs to be on the correct component. Thanks
Sandeep
Mohith Kumar ShrivastavaMohith Kumar Shrivastava
Trying this with new developer ORG without namespace fixed this issue automatically .
This was selected as the best answer