From 6fcd85b999d58426ae1a5311cdbf2ee5a303ec2f Mon Sep 17 00:00:00 2001 From: Chen Yi-Cyuan Date: Wed, 31 Dec 2014 15:02:14 +0800 Subject: [PATCH] add place changed event --- src/ngAutocomplete.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ngAutocomplete.js b/src/ngAutocomplete.js index 3b0b33c..495cf37 100644 --- a/src/ngAutocomplete.js +++ b/src/ngAutocomplete.js @@ -34,7 +34,8 @@ angular.module( "ngAutocomplete", []) scope: { ngModel: '=', options: '=?', - details: '=?' + details: '=?', + placeChanged: '&' }, link: function(scope, element, attrs, controller) { @@ -101,6 +102,9 @@ angular.module( "ngAutocomplete", []) } } } + scope.$apply(function() { + scope.placeChanged(); + }); }) //function to get retrieve the autocompletes first result using the AutocompleteService @@ -163,4 +167,4 @@ angular.module( "ngAutocomplete", []) } }; - }); \ No newline at end of file + });