Closed wiedikerli closed 7 years ago
Thanks for your PR.
Generally it's not good practise to interact with DOM elements in AngularJS controllers, that's what the directive's role is. So rather than moving the code from one place to another as per your PR, I'd rather get to the bottom of the problem and see if there's another way to fix it.
Can you describe what the issue is you're seeing in Firefox? Any console errors in the developer tools? Also can you tell me which version of Firefox and which version of Umbraco you are using?
I dont want to role back, but as far as I remember it was something like this: https://stackoverflow.com/questions/22663861/two-directives-requesting-isolated-scope-and-inherited-scope-on-the-same-element https://stackoverflow.com/questions/17111016/angularjs-access-isolated-scope-in-directives-link-function
Umbraco: 7.6.3 Firefox: 47.0.2
Is there any reason why you use an older version of Firefox? v47 is from June 2016. I can replicate the issue in that browser, but when I try it in the latest version (v54) it is working fine.
Investigating the issue a bit more led me to this issue in AngularJS, where a workaround was suggested to change the directive priority order.
So this is what I have done now and a new version of TextCount (v1.0.10.0) is now available.
Thanks for reporting the issue!
There is an error in firefox when sharing scope between controller and directive. I moved all the directive code into the controller.
Maybe there's a better solution, but this one is working for me.