I need to create an SVG tag in my component. Inside that SVG, I want to create unknown number of polygon components, like polygons, circles, rectangles, and so on. So, I have the data stored in array like:
polygons = [
{
type: 'polygon',
points: "30,0 0,60 60,60"
},{
type: 'circle',
x: 30,
y: 30,
r: 30
}
...
]
This array is being created randomly, and it could have thousands of polygons. So how can we do this in angular 2? In react it was straight forward, but it seems in angular it is kind of tricky.
And one more question, are SVG tags are treated differently in Angular? or they are treated like all other HTML tags?
Any help will be appreciated...