Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

dirty flag when using arrays or promises #75

Open
overloadnn opened this issue Sep 4, 2013 · 1 comment
Open

dirty flag when using arrays or promises #75

overloadnn opened this issue Sep 4, 2013 · 1 comment

Comments

@overloadnn
Copy link

If I get values from array (or promise) the dirty flag is set on initialization.

Ej:

<option ng-repeat="item in array" value="{{item.id}}">{{item.name}}</option>

I solved this by checking if array changed on watch:

// Watch the options dataset for changes
                    if (watch) {
                        scope.$watch(watch, function (newVal, oldVal, scope) {
                            if (!newVal) return;
                            // Check if changed ...
                            if (newVal == oldVal) return;
....
}
@lucassus
Copy link

Did you try to set initSelection: true option?

See my workaround for this problem yakworks/angle-grinder@a3b7f53#diff-89f416fa4784a1fd2988a44207e20e6cR9

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants