This repository was archived by the owner on Apr 30, 2018. It is now read-only.
fix(model): keep track of correct model reference #657
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Fix for issue #656
Why
I did not take into account such basic scenario - no test case was failing and it all seemed to work on my app
How
field
object does not containmodel
property that is the model itself for the basic field usage where the model is$scope.model
. I assumed we could then assign this$scope.model
as a property tofield
object and operate only on this property. This would make it consistent with the scenarios whenfield.model
was passed as a string and resolved to an object (with a watcher) or assigned as an custom object.This was a mistake because when
scope.model
reference changed,field.model
referenced old model object. To make it work I would have to put a watcher onscope.model
and updatefield.model
accordingly but this would add a lot of unnecessary watchers so I've reverted to the original solution where we use constructionfield.model || scope.model
which works fine now.One test case added, one test case fixed.
For issue #656
Checklist:
closes #656