You need to sign in to do that
Don't have an account?
Prema -
How to create a new lightning component when someone inputs in a field and click on Save button then it should create tthe component with the input made by User..
So whenever user enters any name inside the input field it should create a lightning component. Please help me on this.
Use onchange event on the input field and use $A.createComponent to create lightning components dynamically in Javascript controller.
Here is the link to do it:-
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_cb_dynamic_cmp_async.htm
https://salesforce.stackexchange.com/questions/231778/dynamically-create-a-lightning-component-and-put-it-into-a-custom-lightning-comp
Hope it helps, if it does mark it as solved.
Thanks
Thanks for your reply. Could you please let me know how to create it through Metadata API.
Controller as in Apex Class or Controller.js?
1) For Apex Class <aura:component class = "Your Class Name " implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction"access="global" >
2) For Controller.js
<aura:handler type="init" value="{!this}" action="{!c.doInit}"/> --> If you want to perform any action on page load
So in your case you have clickCreate which you can use as it is in your js like:-
clickCreate : function(cmp) { // Find the button by the aura:id value console.log("button: " + cmp.find("findableAuraId")); console.log("button pressed"); }
Hope it helps, if it does mark it as solved.
Thanks