I am making some mistake on calling the function inside another function in my jQuery object. My code is something like this:
var employee = function() {
this.init();
};
employee.prototype = {
init: function() {
$(document).on("click", "#addEmployee", this.addEmployee);
},
updateErrorMsg: function() {
alert('Error');
},
addEmployee: function(e) {
updateErrorMsg();
}
}
I added $(document)
to attach the event because the view is a partial view.
I am getting the error :
Uncaught ReferenceError: updateErrorMsg is not defined
Please assist me what mistake I am doing.