Skip to content

Conversation

@eknowles
Copy link
Contributor

@eknowles eknowles commented Jun 5, 2015

This was breaking in Angular 1.2 because the browser dies on $setDirty as this method can not be called as it doesn't exist.

The fix is to check if the version is <= 1.2 and perform the .$dirty / .$pristine on the model.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 70.81% when pulling c2a14be on eknowles:feature/ngModelSetDirty1.2 into e2734c8 on Textalk:development.

@davidlgj
Copy link
Contributor

Hi @eknowles and thanks for the PR!

But I can't merge this, the files in dist/ are built from the sources, so any changes to it will be overwritten.

But I did fix the bug, you don't need to check version, the if (scope.ngModel.$setDirty()) was there to check for the presence of $setDirty but the extra () meant that it got called instead, so now it's changed to if (scope.ngModel.$setDirty). see:

https://github.com/Textalk/angular-schema-form/blob/development/src/services/decorators.js#L231

@davidlgj davidlgj closed this Jun 12, 2015
@eknowles
Copy link
Contributor Author

Perfect! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants