You need to sign in to do that
Don't have an account?
Jie Gou
javascript in lighting components controller
Hi,
I am trying to add some logic into lighting component controller, in my understanding, it is javascript, so any old-school javascript should work ? Below is my code which does not work :
calculateC : function(component, event, helper) {
var myC = component.get("v.celsius");
var newF = myC*9/5+32;
component.set("v.fahrenheit", newF);
if (typeof my !== "number"){
component.set("v.fahrenheit", 32);
}
},
the part does not work is the typeof
I am trying to add some logic into lighting component controller, in my understanding, it is javascript, so any old-school javascript should work ? Below is my code which does not work :
calculateC : function(component, event, helper) {
var myC = component.get("v.celsius");
var newF = myC*9/5+32;
component.set("v.fahrenheit", newF);
if (typeof my !== "number"){
component.set("v.fahrenheit", 32);
}
},
the part does not work is the typeof
should be
?