-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: ChangeCallBack feature #134
Comments
Could you please provide more info on the need of this event or even better, describe the scenario that you are trying to achieve? |
@bampakoa: change call back has many uses, like in my cases, I would like to perform some activity if there is any changes in the editor, like disable some other fields or change some texts, or show count of characters. |
You could detect any changes that happen on the editor by watching ngModel attribute in your code: |
Yes watching ngModel can be done but don't you think it will increase the number of watcher for angular. |
I don't think you have to worry so much about that, as the latest version of Angular >= 1.5 has many performance improvements. Nevertheless, it always depend on your code (if you are using already many watches etc....). Also, it would be better to watch the model rather than polluting the rootScope with an event. Just to clarify also that when you add a watch, that counts for 1 watch no matter how many times the event will fire. |
Yeah, that is the whole reason I am avoiding using it with watch, there are already a lot of things being watched. No, I don't have to put it in rootScope, I have bind it with JQuery 's "DOMSubtreeModified" event. |
Hi,
Wouldn't it be great to have a changeCallBack option, alike pasteCallBack.
I have modified the code and have implemented change callback by binding "DOMSubtreeModified" event with debounce, so that it won't get called so often. Is it a good approach, any suggestion would be good.
The text was updated successfully, but these errors were encountered: