+ Start a Discussion
Venkat  163Venkat 163 

how to pass parameters(variable) dynamically from visual force page to lightning component

I am storing (holding) account id in one variable in apex class by using getter and setter and also I am able to acess that variable into vf page,
but I am calling lightning component in vf page by using $Lightning.createComponent() please find below my code.

function createContact(){ $Lightning.use("c:Create_ContactApp", function() { $Lightning.createComponent("c:Create_Contact", { accId : "{!acid}" }, "lightning", function(cmp) { cmp.set("v.accId",acid); console.log("button was created"+acid); // do some stuff } ); }); }   

in the above code i am using "acid" variable (I am storing account id) but account id not passing dynamically  from vf page to lightning component.

If any one worked around this type of senario please give your solution.
Mohammad Ishaque 14Mohammad Ishaque 14
Hey Venkat, Did you find solution for this?