You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 29, 2019. It is now read-only.
In dismissClickHandler we have to call originalScope.$digest() to update the is-open binding. But if the typeahead directive is transcluded, originalScope is the transcluded scope.
I tried to change the handler to use (originalScope.$$transcluded ? originalScope.$parent : originalScope).$digest(); and it works. originalScope.$apply() seems to work too. But I don't know if this makes sense.
Link to minimally-working plunker that reproduces the issue:
I think one would have to create a function to recursively walk up the $scope tree, since presumably originalScope.$parent.$$transcluded could be true as well.
@wesleycho Do you think we could do a while(originalScope.$$transcluded) originalScope = originalScope.$parent; right at the beginning? It doesn't break any unit test and fixes this issue.
I've written a unit test for this and could prepeare a PR.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug description:
This is related to this (fixed) issue: #5467
In
dismissClickHandler
we have to calloriginalScope.$digest()
to update the is-open binding. But if the typeahead directive is transcluded,originalScope
is the transcluded scope.I tried to change the handler to use
(originalScope.$$transcluded ? originalScope.$parent : originalScope).$digest();
and it works.originalScope.$apply()
seems to work too. But I don't know if this makes sense.Link to minimally-working plunker that reproduces the issue:
http://plnkr.co/edit/QGt0h0mUz25QI4LcjZ4K?p=preview
Version of Angular, UIBS, and Bootstrap
The text was updated successfully, but these errors were encountered: