Hi Joilson,
We suggest you to use diagram’s nodeTemplate property and add the node at runtime using created event. Please refer to the below code example and sample.
Code example:
<ng-template #nodeTemplate let-data >
<ng-container *ngIf="data.id == 'node1_template'">
<div class="diagram_border_cus diagram_border_cal">
<ejs-daterangepicker #dateRangePicker format='MM/dd/yyyy' ></ejs-daterangepicker>
</div>
</ng-container>
<ng-container *ngIf="data.id == 'node2_template'">
<div style="height:100%;width:100%;background:whitesmoke">
<input type="button" value="Hello" >
</div>
</ng-container>
</ng-template>
public nodes: NodeModel[] = [
{
id: 'node1_template', offsetX: 409, offsetY: -151, width: 250, height: 30,
shape: { type: "HTML" }, constraints: NodeConstraints.Default & ~NodeConstraints.Resize & ~NodeConstraints.Rotate
}
];
public created(): void {
this.diagram.fitToPage();
this.diagram.add( {
id: 'node2_template', offsetX: 150, offsetY: -150, width: 250, height: 30,
shape: { type: "HTML" }, constraints: NodeConstraints.Default & ~NodeConstraints.Resize & ~NodeConstraints.Rotate
} ) ;
}
Regards,
Naganathan K G
1