angular-input-modified
angular-input-modified copied to clipboard
TypeError: Cannot read property '$$notifyModelModifiedStateChanged' of null
I used this module in a uib-modal (https://angular-ui.github.io/bootstrap/). The data modal that is passed to the modal is reloaded prior to being opened again.
I found that adding the same checks you had in onInputValueChanges() to setPristine() fixes it.
Changing from: // Notifying the form. formCtrl.$$notifyModelModifiedStateChanged(modelCtrl);
to:
// Notifying the form.
if (formCtrl && 'function' === typeof formCtrl.$$notifyModelModifiedStateChanged) {
formCtrl.$$notifyModelModifiedStateChanged(modelCtrl);
}