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

fix(input): re-evaluate value if min/max changed - #4788

Closed
quazzie wants to merge 1 commit into
angular:masterfrom
quazzie:input-min-max
Closed

quazzie wants to merge 1 commit into
angular:masterfrom
quazzie:input-min-max

Conversation

@quazzie

@quazzie quazzie commented Nov 5, 2013

Copy link
Copy Markdown
Contributor

Value was not re-evaluated when min/max changed.

Comment thread src/ng/directive/input.js

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This optimisation could fail if max and min changed at the same time in such a way that max+''+min stayed the same:

22 + '' + 23 == '2223'
2 + '' + 223 == '2223'

Admittedly, this is a highly unusual and contrived case but the performance improvement is not going to be so great (if at all) to warrant it.

@petebacondarwin

Copy link
Copy Markdown
Contributor

Given the optimization comment above and that $observe is optimized not to use watches in many cases, it is better to go with #4797

@quazzie

quazzie commented Nov 12, 2013

Copy link
Copy Markdown
Contributor Author

Agreed.

@quazzie
quazzie deleted the input-min-max branch November 12, 2013 11:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants