Hi Alixeer,
Your code deals with two worlds here. AngularJS world and jQuery world (or non-AngularJS world).
ng-click wraps the $apply() call internally. So you don't have to call it explicitly. As a result $apply() will be called automatically. After $apply() ends, digest cycle ($rootScope.$digest()) runs and watchers will be called. This updates the DOM with the new model value (as you have {{}}).
But the following model update from the jQuery doesn't trigger this flow.
<pre lang="php">$("#employee").autocomplete({
select: function (event, ui) {
$scope.employeesReceiveMessage = [{
ID: 1,
Name: 'A B'
}];
}
})
As a result, you have to explicitly call $apply() to trigger the above mentioned flow.
Hope that makes sense.
Regards,
Roshan.