I tried to call the following jQuery function with $http.get from an AngularJS function.
But call cannot be executed.
The following is the jQuery function
function msgBar(){
$http.get("<%=request.getContextPath()%>/msg_in_session")
.success(function(msg_ssn){
alert('msg_ssn');
if(msg_ssn.split("|||::|||")[0]=='S')
msg(msg_ssn.split("|||::|||")[1]);
else if(msg_ssn.split("|||::|||")[0]=='F')
msgF(msg_ssn.split("|||::|||")[1]);
});
}
And the following is the Angular JS call
angular.module('myApp', []).controller('MANAGE_SERVICES', function($scope, $http) {
$scope.editService = function(){
$("#loadingDiv").fadeIn();
$http.get("<%=request.getContextPath()%>/manage/service/edit/"+$scope.selectedServiceId+"/"+$scope.editName)
.success(function(response) {
$http.get("<%=request.getContextPath()%>/MANAGE_SERVICES_JSON")
.success(function(response) {
$scope.services = response;
$("#loadingDiv").fadeOut();
msgBar(); //This is the call
});
});
}
});
But the call is not working when I use $http.get. But if this is not used, then this function call works. And this function is working when this is defined in the same angular controller. But I need to call this in other controllers also. So I need to define this like this itself.