facultymatt / angular-unsavedChanges

angular-unsavedChanges
175 stars 81 forks source link

not working with ng-form #37

Open cstephe opened 9 years ago

cstephe commented 9 years ago

The todo "refactor, temp fix for issue #22" causes an issue where ng-form is not respected.

I'm fixing it on my fork by doing something like:

   while(count < 3 
        && formElement[0].tagName !== 'FORM' 
        && !_.findWhere(_.values(formElement[0].attributes), {name:'ng-form'})) 

Sorry about the underscore but I've already had to fork to add support for custom dialogs and I brought in a ui-router on my fork as a dependency, but if this helps then thats great.