Everything works fine when I wrote the js logic in a closure as a single js file, as:
(function(win){
//main logic here
win.expose1 = ....
win.expos
Error Case:
var userListQuery = {
userId: {
$in: result
},
"isCameraAdded": true
}
( cameraInfo.findtext != "" ) ? searchQuery : userListQuery;
Output:
TypeError: (intermediate value)(intermediate value) is not a function
Fix: You are missing a semi-colon (;) to separate the expressions
userListQuery = {
userId: {
$in: result
},
"isCameraAdded": true
}; // Without a semi colon, the error is produced
( cameraInfo.findtext != "" ) ? searchQuery : userListQuery;