You need to sign in to do that
Don't have an account?
andrew taylor 3
Lightning - Controller Error
I'm following the example shown on Peter Knolle's post here: https://developer.salesforce.com/blogs/developer-relations/2015/03/lightning-component-framework-custom-events.html
When creating the contactSearch Component, I'm getting the following error:
"Failed to save undefined: No CONTROLLER named apex://mynamespace.ContactSearchController found: Source"
I'm not sure what I've missing - any thoughts?
When creating the contactSearch Component, I'm getting the following error:
"Failed to save undefined: No CONTROLLER named apex://mynamespace.ContactSearchController found: Source"
I'm not sure what I've missing - any thoughts?
I have seen the example the hierarchy of example is wrong.I think the error you got may be because you save the component with controller name before creating the controller or may be because of your namespace. Use the below link it is salesforce lightning guide :
https://resources.docs.salesforce.com/sfdc/pdf/lightning.pdf
Please let me know if this is help you.
Thanks
I created the controller first and still ahving the issue.
The error message is "Failed to save undefined: No CONTROLLER named apex://lvv.MyContactLestController found: Source". I don't know if this is related to my dev org having a namespace prefix?
Hope it helps.
I am definitely using the correct namespace and I created the apex controller before the component so it definitely exists.
I eventually got this working by switching to a new Developer Org instead of my usual one.
Try creating a new Developer Org and then create the component. You can then connect trailhead to the new org, complete the challenge and then switch trailhead back to the original org.
This did the trick, and I was then able to reference the Class in the Component and save it.
1 - closed everything in the console
2 - logged out
3 - closed my browser
4 - logged in
5 - opened my component and put some other old class that I had in the system as controller
6 - it saved successfully
7 - changed it to new class name and saved
<aura:component controller="MyNamespace__.MyContactListController">
</aura:component>
Once the lightning component is saved, it will display the code as:
<aura:component controller="MyNamespace.MyContactListController">
</aura:component>
Hope this helps.
1. Save the component with a random class you currently have in the system
2. Change the class to what you want it to be, and press save
Good times.....
I deleted the existing controller and then created new one and new one defined in controller of Aura:component.
It worked for me.
Hope this helps for you as well!!!
Happy Lightning!!! :)
This worked :)
The double underscore approach worked for me and thanks for the suggestion. Any idea where it is documented?
Thanks
Jay
Thanks for saving my night.
Reason why I had to remove it is because one of Trailhead challenge too assumes there's no namespace__. else it wasn't verifying the step :(
totally stuck help pls...!!!!!!!!!!
Thank you!!!
I had the same issue with the "Create a Lightning Component" unit.
I had to create a new Apex Class in Developer Console for this to work properly.
Go to : File > New > Apex Class
Name it the same as your controller. Then click File > SAVE.
Then go back to your Lightning Component and add the controller="MyContactListController" to the aura: component tag and click File > Save.