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 May 25, 2019. It is now read-only.
In your link function, you can setup $scope.opts and would expect this to take effect.
However, it does not, because the method here will get newValues === oldValue. This means the initial digest will set no options.
The reason this happens is the following code inside angular's $digest:
watch.fn(value, ((last === initWatchVal) ? value : last), current);
On initial digest, last === initWatchVal, so you will receive value as both parameters and never set any codemirror options until the second iteration/change.
A workaround for now seems to be to set the options as some empty object, then set the real object in the next iteration/digest.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If you create a directive which has a template like so:
In your
link
function, you can setup$scope.opts
and would expect this to take effect.However, it does not, because the method here will get
newValues === oldValue
. This means the initial digest will set no options.The reason this happens is the following code inside angular's
$digest
:On initial digest,
last === initWatchVal
, so you will receivevalue
as both parameters and never set any codemirror options until the second iteration/change.A workaround for now seems to be to set the options as some empty object, then set the real object in the next iteration/digest.
The text was updated successfully, but these errors were encountered: