AngularJS setting model value from directive and calling a parent scope function holds on to the previous value inside that function
问题 js fiddle http://jsfiddle.net/suras/JzaV9/4/ This is my directive 'use strict'; barterApp.directive('autosuggest', function($timeout, $http) { return { restrict: "E", scope: { modelupdate:"=", suggestions:"=", urlsend:"@" }, template: '<ul><li ng-repeat="suggest in suggestions" ng-click="updateModel(suggest)">{{suggest}}</li></ul>', link: function (scope, element) { scope.$watch('modelupdate', function() { $timeout(function(){ $http.post(scope.urlsend, {q:scope.modelupdate}).then(function