Svg.js: Could you please provide me the typescript library which can be used in angular 2

Created on 21 Sep 2016  路  7Comments  路  Source: svgdotjs/svg.js

Could you please provide me the typescript library which can be used in angular 2?

typescript

Most helpful comment

For those wanting to use svg.js with Angular2 (or just wanting to use modules) here's how you can do it. Define your import statement like this:

import * as SVG from 'svg.js';

You should then be able to use svg.js as the documentation states. For typing your objects, all the definitions will also be on the SVG object (SVG.Element, SVG.Path, etc).

Hope this helps.

All 7 comments

How is the typescripf file in the repo differnt from the the one you need in angular?

Getting lot of errors using the typings provided
?

@rdfriedl isnt the typescript definition up to date?

Uncaught Error :this.svg.polyLine is not a function

i cant say whether it is up to date or not, also there are a few odd bugs in it.
for example i did not build the definitions for SVG.FX class
i built it over the course of a few days so i was not able to test everything.

if you could provide some code that is throwing the error that would help, though i cant say if i have time to fix it 馃槙

For those wanting to use svg.js with Angular2 (or just wanting to use modules) here's how you can do it. Define your import statement like this:

import * as SVG from 'svg.js';

You should then be able to use svg.js as the documentation states. For typing your objects, all the definitions will also be on the SVG object (SVG.Element, SVG.Path, etc).

Hope this helps.

@yashwanthkata is this still an issue? If so, please give us a feedback. Otherwise I will close this in a few days...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mixn picture mixn  路  9Comments

mtbradle-ge picture mtbradle-ge  路  6Comments

AlessandroDM picture AlessandroDM  路  5Comments

crystalfp picture crystalfp  路  3Comments

Salitehkat picture Salitehkat  路  4Comments