Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

perf(ngModelOptions): do not trigger digest during debounce #8850

Closed
wants to merge 1 commit into from
Closed

perf(ngModelOptions): do not trigger digest during debounce #8850

wants to merge 1 commit into from

Conversation

shahata
Copy link
Contributor

@shahata shahata commented Aug 29, 2014

BREAKING CHANGE:
This change means that anyone watching $viewValue will no longer see the update immediately for debounced updates

Closes #8814

@matsko
Copy link
Contributor

matsko commented Aug 29, 2014

Could you add a digest surrounding the async validator code inside of runValidators? Async validations will need to run a digest to kick off something like $http.

@shahata
Copy link
Contributor Author

shahata commented Aug 29, 2014

@matsko I'm not sure why this is needed... $$runValidators will still be followed by a digest even with this change (unless someone calls $commitViewValue or $validate without scope.$apply, but all code inside angular is protected nicely as far as I can see)

@shahata
Copy link
Contributor Author

shahata commented Aug 29, 2014

Am I missing something?

@matsko
Copy link
Contributor

matsko commented Aug 29, 2014

Ah yes sorry. That's because of $writeModelToScope. You can ignore what I said.

BREAKING CHANGE:
This change means that anyone watching `$viewValue` will no longer see the update immediately for debounced updates

Closes #8814
@caitp
Copy link
Contributor

caitp commented Sep 2, 2014

I'm not sure if we need a test case for this, because running or not running a digest seems like an implementation detail that doesn't matter a whole lot --- it's primarily a perf fix, so if it doesn't break any existing tests we should be good.

Maybe someone else will disagree, we'll see

@caitp
Copy link
Contributor

caitp commented Sep 2, 2014

I like the look of the patch though. fwiw

@caitp caitp added this to the 1.3.0-rc.1 milestone Sep 2, 2014
@tbosch tbosch self-assigned this Sep 3, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ng-model-options debounce seems to still trigger "dirty model checking" cycle
6 participants