-
Notifications
You must be signed in to change notification settings - Fork 75
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
Duplicated tweet button #60
Comments
Do you constantly update the scope? Can you put a debugger in the function renderTwitterButton and see if it gets called multiple times? |
Yes it does get called 2 times when I tried but sometimes the button displayed just once and the function got called twice. I just update the scope when the page is loaded. Thanks |
Its definitely coming in twice, but it's not on every load. |
This bad! I'll get a fix by next week
|
Appreciate! |
I managed to solve this issue. I included a counter in the twitter directive. |
robertodugim's solution does the job, even if it's a dirty fix.Did not manage to understand why it gets called 2 times sometimes? |
Angular uses Dirty checking on the Plain javascript object. If you change anything on the scope it does not know which values are changed until it checks every value. Even for computed values it reruns the computation hence it gets called multiple times. A debounce function makes sure the directive is called only one within a time frame of 75 milliseconds. The ideal solution for this is increasing the deboucne count instead of doing the dirty fix. Can you please increase the debounce to say 200 milliseconds and let me know if this is still reproducible? Also I have been ignoring this project due to having a busy life. I promise to get back to it soon. Sorry! |
Hi!
First of all, congratulations for this project! Its awesome.
In my Angular JS project, I'm using the tweet button and sometimes It appears duplicated. This is my code (I'm using Jade template engine)
The text was updated successfully, but these errors were encountered: