-
-
Save yuval23/af74457c28933a54536d98c3f5774f6c to your computer and use it in GitHub Desktop.
Create a Dynamic component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doCreateComponent: function(component, compName, compParameters ,divId){ | |
let namespace = 'c:'+compName; | |
$A.createComponents([ | |
[namespace,compParameters]], | |
function(components, status, errorMessage){ | |
if (status === "SUCCESS") { | |
var comp = components[0]; | |
var compDiv = component.find(divId); | |
compDiv.set("v.body", comp); | |
} | |
else if (status === "INCOMPLETE") { | |
console.log("No response from server or client is offline.") | |
// Show offline error | |
} | |
else if (status === "ERROR") { | |
console.log("Error: " + errorMessage); | |
// Show error message | |
} | |
} | |
); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment