Snap.svg icon indicating copy to clipboard operation
Snap.svg copied to clipboard

Snap.svg and Angular2

Open AliObaji opened this issue 7 years ago • 3 comments

So I've read alot about the problem, but I haven't seen an official solution posted. I've created an angular-cli project. And ran 'npm install snapsvg -s', then I imported it in my component using "import 'snapsvg' ". But I get this error when trying to load: "Uncaught TypeError: Cannot read property 'on' of undefined" Can you please post an official solution to this problem ?

AliObaji avatar Jun 10 '17 08:06 AliObaji

I would also like to know how to use this on angular4

Hesesses avatar Jun 16 '17 09:06 Hesesses

I have no idea if it is official solution or not but for me using https://github.com/geelen/Snap.svg-cjs worked like a charm. you can install this package with npm and use it in place of raw snapsvg. cjs uses raw version as a dependency anyway. here is a working example (also for angular4): https://github.com/stevefarwell/angular2-snapsvg-demo

Asele avatar Aug 10 '17 14:08 Asele

See #483

drwpow avatar Aug 11 '17 11:08 drwpow