I am new to javascript and I am trying to debug an Angular application in the browser dev tool and want to call an anonymous function from the console. Is there a way to do this? I may not even be understanding the code I am looking at when debugging this application in the browser. Below is a sample of the .js file I put a break point in.
I am a bit confused what this function shown is. It's not self executing, but it is anonymous. How is this function ever called by the application? Can anyone help me understand the below code?
It seems it's an anonymous function that has angular module factory - which from what I am reading is the way to define a service? If so, how can I call for example, the 'A' functions in the console to debug?
!function() {
"use strict";
angular.module("customPlugin", ["coreFw"]),
angular.module("naviBar", ["coreCw", "customPlugin"])
}(),
function() {
"use strict";
angular.module("moduleName").factory("naviBar", ["$q", "$window", function(a, i, s) {
var n = function(e) {
return !0 === e || !1 === e || "[object Boolean]" === toString.call(e)
},
A = {
init: function() {
a(A.watch, A.watchInterval)
},
watch: function() {
A.session.monitor(),
A.height.monitor(),
a(A.watch, A.watchInterval)
}
};
}
])
}();