How to Set HTML Templates for Multiple Nodes in Angular Diagram?
In this article, you can learn how to set HTML templates for multiple nodes in Angular Diagram. In Syncfusion® Angular Diagram, you can set individual HTML templates for multiple nodes by utilizing HTML-type nodes with content templates. A content template is used to define custom HTML content within nodes. To employ a custom HTML template, configure the node’s shape property to HTML and assign the desired template to the content property. This property specifies the HTML content to be rendered inside the node.
The below code snippet explains how to set individual HTML template for nodes
<e-node id="node1" [offsetX]="100" [offsetY]="100" [width]="120" [height]="100" [shape]="shape1"></e-node>
<e-node id="node2" [offsetX]="300" [offsetY]="100" [width]="120" [height]="100" [shape]="shape2"></e-node>
public shape1: HtmlModel = {
content: '<div style="background:#6BA5D7;height:100%;width:100%;"><button type="button" style="width:100%">Button</button></div>',
type: 'HTML'
};
public shape2: HtmlModel = {
content: '<div style="background:#FBF6A4;height:100%;width:100%;"><input type="color" value="#ff0000" style="width:100%"></div>',
type: 'HTML'
};
Refer to the working sample for additional details and implementation: Click here for sample
Conclusion
We hope you enjoyed learning how to set individual HTML templates for multiple nodes in Angular Diagram.
You can refer to our Angular Diagram feature tour page to learn about its other groundbreaking feature representations and documentation, as well as how to quickly get started with configuration specifications. You can also explore our Angular Diagram example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to explore our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, BoldDesk Support, or feedback portal. We are always happy to assist you!