Articles in this section
Category / Section

How to import JsRender template in Angular component file?

1 min read

In Angular we can easily import JsRender template using “document.write()”  in angular component file itself. We can declare templates inside the constructor for custom template in Gantt.

The below code example explains about how to import JsRender template:

[ts]
constructor() { 
       this.renderTemplate();
}
renderTemplate(){
        document.write('<script type="text/x-jsrender" id="taskbarTemplate">' +
        '<div class="e-gantt-template-taskbar bg-color" style="border-radius:5px;overflow:hidden;-webkit-transform:translateZ(0);-webkit-mask-image: -webkit-radial-gradient(circle, white, black);">'+
                                     //…    
    '</script>'+
    '<script type="text/x-jsrender" id="parentTaskbarTemplate">'+
                                   //..
     '</script>' );
 }
 
[html]
<ej-gantt id="GanttControl" 
             [taskbarTemplate]="taskbarTemplate"  
             [parentTaskbarTemplate]="parentTaskbarTemplate">
              //..
</ej-gantt>

 

You can find a sample on how to import JSRender template in Angular component file here.

 

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied