Hi,

I am adding components to an svg view, but for some UNKNOWN reasons  they
 are not added INSIDE the svg component but after it (see screenshot)

html template :
<svg #mysvg viewBox="0 0 1000 1000" (mousemove)="onMouseMove($event)" 
(mouseup)="onMouseUp($event)">
<svg:defs>
<svg:linearGradient id="myLinearGradient1"
x1="0%" y1="0%"
x2="0%" y2="100%"
spreadMethod="pad">
<stop offset="10%" stop-color="#cccccc" stop-opacity="1"/>
<stop offset="30%" stop-color="#eeeeee" stop-opacity="1"/>
<stop offset="70%" stop-color="#eeeeee" stop-opacity="1"/>
<stop offset="90%" stop-color="#cccccc" stop-opacity="1"/>
</svg:linearGradient>
</svg:defs>
<svg:g gantt-bar width="100" (mousedown)="onMouseDown($event)"/>
<svg:g #arrow arrow />
</svg>
code 

@ViewChild('mysvg',{read: ViewContainerRef}) mysvgcontainer:ViewContainerRef
;


ngAfterContentInit() {
let gantt_bar = this._cr.resolveComponentFactory(GanttBarComponent);
for (let n=0;n < this.sequences.length;n++)
{
console.log("create new component",n);
let componentref = this.mysvgcontainer.createComponent(gantt_bar);
(<GanttBarComponent>componentref.instance).y = 10*n;
}
}

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to