Conflict with Prototype.js #6221

Closed
webspeaks opened this Issue Jan 2, 2016 · 4 comments

Projects

None yet

3 participants

@webspeaks

I tried integrating angular 2 with Magento framework which uses Prototype as its main JS framework.
But angular 2 does no run on it. Even if you include prototype.js in any simple angular app, it will break.

I have created a plunker: http://plnkr.co/edit/XKKpriTPrTX3tXqqz8v2?p=preview

Error: No provider for ExceptionHandler!

@nikolafon

This is a show stopper for me. I'm migrating Richfaces, which apparently is using Prototype.js, to the Angular 2 and for the time being I have to run it side by side. Angular 2 is crashing with this error when trying to bootstrap.

@nikolafon

Prototype overrides behaviour of Array.from function. It might be prototype issue not Angular.
If you change prototype library (comment Array.from = $A; line) Angular works just fine.
Angular can't control what other shim libraries you use and you can brake a lot of stuff if you alter standard javascript functions.

@webspeaks

@gdi2290 Its awesome. Thanks a ton for your help 👍

@webspeaks webspeaks closed this Jan 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment