• Omar Bensouda Korachi 5
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Welcome all,

I try to pass module Create a HelloWorld Lightning Component  but I'm facing following error: "Challenge Not yet complete... here's what's wrong: The 'HelloWorld' component does not contain the correct code." however I cannot find this error here are my codes 

helloWorld.cmp:
<aura:component controller="HelloWorldController" implements="flexipage:availableForAllPageTypes"> 
<aura:attribute name="greeting" type="String" default="World" />
<lightning:input name="Greeting" label="Greeting" value="{!v.greeting}"/>
 <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
 Hello, {!v.greeting}!
</aura:component>

apex HelloWorldController : 
public with sharing class HelloWorldController {
@AuraEnabled
public static User getCurrentUser() {
return [SELECT Id, FirstName, LastName FROM User WHERE Id = :UserInfo.getUserId() LIMIT 1];
 }
 }

and js HelloWorldController:
({
doInit : function(component, event, helper) {
var action = component.get("c.getCurrentUser");
action.setCallback(this, function(response) {
var user = response.getReturnValue();
component.set("v.greeting", user.FirstName);
})
$A.enqueueAction(action);
}
})

The worst thing in this situation is that I check in my org and everything works as it should. 
After the end of challenge I am not getting any error but at the same time I am not getting the out put as well. i am only seeing the image.

User-added image