You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
I'm currently trying to start a project with "angular4" and "ckeditor5" and I noticed that I'm not able to use "ckeditor5" because of "zone.js". The thing is that "ckeditor5" is using "isNative" method from "lodash" library to determine if "addEventListener" is a native method or not and then, based on that, do its stuff. However, when "zone.js" is included un the page, "isNative" returns "false" for "addEventListener". Indeed:
document.getElementById('XXX').addEventListener
returns
function addEventListener() { [native code] }
when "zone.js" is not referenced and:
function addEventListener(){return f(this, arguments)}
when it is, making the "isNative" function of "lodash" not really reliable anymore (this could be argued as the function is indeed not native anymore, but at the end of the day, "addEventListener" is supposed to be native).
The real source of the issue is arguable. Indeed, separately, every library work correctly but it's once we associate them that the problem occurs. I posted an issue on "ckeditor github" (ckeditor/ckeditor5#413) as at first I didn't know where the issue came from and a dev over there said something interesting:
Anyway, there are two options – either zone.js fixes this or we do. From a puristic POV I'd say that it should be zone.js. It's very unlikely that they'll stop changing the native prototypes, so at least they could fix the toString() properties of functions they assign to native prototypes. This would fix the root of the issue and prevent similar errors in the future (we're using Lodash's isNative() function, so there may be more libraries doing so).
Maybe the solution he proposed could be the correct one if it makes "isNative" function returns the correct value.
Otherwise, I think it could be interesting to discuss about a solution.