This is probably pretty stupid but it's been bugging me for a little while now. Trying to get something going with AngularJS and this is killing me.
Within a callback I have something like so:
var xyz = {
"modA" : null,
"modB" : null,
"modC" : null
}
I then attach some methods as well...
xyz.setModA = function(elementId) {
var someConfig = {};
// attach some kind of event callback on stateChange
someConfig.events.onStateChange = this.helper;
this.modA = new someObject(someConfig);
}
xyz.setModC = function(vars) {
....
}
xyz.helper = function(event) {
....
this.setModC(vars);
}
When the state of the modA object we instantiated changes then the onStateChange event occurs and correctly fires the xyz.helper method I have but then I instantly get an Uncaught TypeError: undefined is not a function ? For some reason it's not seeing the setModC method now when the event fires?
this.setModC = 'something';inxyz.helperblow away yoursetModCmethod?