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

$watchCollection informs the old collection array values in the second argument of the listener. fixes #1751 #3865

Closed

Conversation

gonzaloruizdevilla
Copy link
Contributor

$watchCollection correctly informs the old collection values in the second argument of the listener (before it informed an array with the same values as the new collection)

select, input and nglist are affected by this change

There is a behaviour change in ngList, when you type "a , b" it automatically changes the value to "a, b" (this is reflected in inputSpec.js#989 change)

Gonzalo Ruiz de Villa added 3 commits September 3, 2013 20:54
…he former array data

related to angular#1751
When watching arrays, $watchCollection returned the new data both in the newCollection
and the oldCollection arguments of the listener
With the fix on watchCollection, this code needed to be updated to run
all previous tests on select.
fixes angular#1751

When the model referenced the same same array and the array values
where changed, the list wasn't updated.
Now watchCollection is used to detect changes in NgModelController.

isEmpty now detects empty arrays

BEHAVIOUR CHANGE
There is a change in the behaviour of ngList when typing a list.
When “a , b” is typed is automatically changed to “a, b”.
@IgorMinar
Copy link
Contributor

I'm sorry, but I wasn't able to verify your CLA signature. CLA signature is required for any code contributions to AngularJS.

Please sign our CLA and ensure that the CLA signature email address and the email address in this PR's commits match.

If you signed the CLA as a corporation, please let me know the company's name.

Thanks a bunch!

PS: If you signed the CLA in the past then most likely the email addresses don't match. Please sign the CLA again or update the email address in the commit of this PR.
PS2: If you are a Googler, please sign the CLA as well to simplify the CLA verification process.

@gonzaloruizdevilla
Copy link
Contributor Author

I had signed the CLA in the past, but I think I used my gmail address. Anyway, I have signed the CLA twice with both addresses again.

@IgorMinar
Copy link
Contributor

btw it would be much easier and faster to get these changes in if you would create 1 PR for each commit and just mention in the comments that the last two depends on the first one.

@ghost ghost assigned IgorMinar Jan 7, 2014
@gonzaloruizdevilla
Copy link
Contributor Author

Thanks for your review.
Tonight I'll check all your comments and I will split it in three different PR.

@gonzaloruizdevilla
Copy link
Contributor Author

I have splited the PR in two:

-- #5688
-- #5689

I squashed the last two commits in one, as the one affecting select.js only has sense with the changes on input.js

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.

2 participants