From 7afa3752d66dc38e99a72e52f451ff5027f429d5 Mon Sep 17 00:00:00 2001 From: Wesley Cho Date: Sat, 5 Mar 2016 10:58:30 -0800 Subject: [PATCH] fix(typeahead): change to original scope - Change to original scope for running $digest --- src/typeahead/typeahead.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/typeahead/typeahead.js b/src/typeahead/typeahead.js index ebb87004f8..f364bcee81 100644 --- a/src/typeahead/typeahead.js +++ b/src/typeahead/typeahead.js @@ -401,7 +401,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap evt.stopPropagation(); resetMatches(); - scope.$parent.$digest(); + originalScope.$digest(); break; case 38: scope.activeIdx = (scope.activeIdx > 0 ? scope.activeIdx : scope.matches.length) - 1; @@ -455,7 +455,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap if (element[0] !== evt.target && evt.which !== 3 && scope.matches.length !== 0) { resetMatches(); if (!$rootScope.$$phase) { - scope.$digest(); + originalScope.$digest(); } } };