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 has been archived by the owner on Apr 12, 2024. It is now read-only.
So when you change the text field in the directive it updates the controller value $scope.name which triggers the $watch, which in turn sets $scope.computed to the same value.
This does not work if your controller is a ui.bootstrap $modal Controller. It updates the $scope.name correctly in the Modal dialog view, but the Controller value for $scope.name is unchanged and doesn't trigger the $watch. e.g.
@continuata this is due to the fact that there is a transclusion scope between your controller and a template. You can find more info and work-arrounds in angular-ui/bootstrap#969
using the
scope
definition in directives allows you to sync with controller variables from the parent controller ... like thisSo when you change the text field in the directive it updates the controller value
$scope.name
which triggers the$watch
, which in turn sets$scope.computed
to the same value.This does not work if your controller is a ui.bootstrap
$modal
Controller. It updates the$scope.name
correctly in the Modal dialog view, but the Controller value for$scope.name
is unchanged and doesn't trigger the$watch
. e.g.Please see this Plunker which demonstrates this behaviour.
Is this a bug in ui.bootstrap or in Angular?
EDIT: this also happens when the scope of the directive isn't isolated.
The text was updated successfully, but these errors were encountered: