SetUp
npm install angular-svg
Usage
import { SvgCircleModule, SvgLineModule, SvgPolygonModule, SvgPolylineModule, SvgTextModule, SvgPathModule } from 'angular-svg'
Modules List :
- SvgCricle
- SvgText
- SvgRectangle
- SvgPolygon
- SvgPolyline
- SvgLine
- SvgEllipse
- SvgPath
In Html
Add a root svg tag in your html
//Your root svg tag here
// for circle
<g svg-circle [circle]="circle" (circleMousedown)="onCircleClick($event)">
// for line
<g svg-line [line]="line" (lineMousedown)="onLineClick($event)">
//for polygon <g svg-polygon [polygon]="polygon" (polygonMousedown)="onPolygonClick($event)">
// for polyline
<g svg-polyline [polyline]="polyline">
//for svg path
<g svg-path [path]="pathString" [stroke]="colorstroke">
// for svg text
<g svg-text [text]="text">test
// Svg end tag
Demo
Support
Please reach me for any issues/features/updates :kata.yaswanth@gmail.com