Closed ghost closed 8 years ago
I had a look into this one and would like you guys to validate the approach. In one of the previous discussions it turned out we are not following exactly the same path as ng-material team, so I thought about going our own way.
Have a look at my fork, where I fixed the issue for the text field so far (not text area). I basically hooked into ng-change
event on the internal input field and from there set $dirty
on the bound model. I also hooked into blur
event, where I set the $touched
as this one was also missing. I think it's simple enough and it's not over-engineered.
Let me know what do you think about this approach. Code is in my fork, in the textfield-dirty-change
branch: https://github.com/jjczopek/ng-officeuifabric/tree/textfield-dirty-change
I really like this... seems very simple and easy to implement. Any downsides?
I haven't found any :) for text field it was easy enough because the events where already in scope, for other directives it might be necessary to add some events to the input, but I don't consider this as a downside.
Will raise PR for this soon and start working on other directives to have this covered as well.
Refer to https://github.com/ngOfficeUIFabric/ng-officeuifabric/issues/361 for more information.