I am calling an AngularJS function inside a jQuery function, but the execution is not sequential. When I execute this page, the jQuery alert shows first instead of AngularJS alert. How can I confirm that the AngualarJS function has executed? After executing the AngularJS function it should execute the next line on jQuery.
Javascript function :-
(function( $ ){
$.fn.multipleInput = function() {
return this.each(function() {
angular.element('#theController').scope.getFullName($input.val());
alert("AFTER ANGULAR JS");
}
});
AngularJS function :-
var bipin=angular.module("ui.bootstrap.demo",['ui.bootstrap']);
bipin.controller('theController',['$scope','$q','$http','$window', function($scope,$q,$http,$window){
$scope.selected = '';
$scope.email = '';
$scope.fullName = '';
$scope.getFullName= function(item) {
alert();
return $http.get('https://myservice/v1/query/'+$label)
.then(function(response){
return response.data.items.map(function(item){
alert("INSDE ANGULAR JS");
$scope.fullName=item.fullName;
return item.fullName;
});
});
};