I just wanted to know if it is possible to prevent the compilation of angularjs directives ?
I use the jQuery Slick Grid plugin to display some datagrids in my website, and I imagined a way to define easily the cells templates with nested directives containing HTML.
The problem is that this HTML code is meant to be used as a template but AngularJS compiles it before the grid is initialized! (seems logical though...)
Thanks in advance !
EDIT: Here is an example of my directive.
<div class="datagrid" my-datagrid="o in collection">
<div my-datagrid-column="col1">
<div>{{o.col1}}</div>
</div>
<div my-datagrid-column="col2">
<div custom-directive-with-transclusion="foobar">{{o.col2}}</div>
</div>
</div>
So here it is, I have a parent directive my-datagrid
which contains several my-datagrid-column
describing each columns of the grid. Eech of these my-datagrid-column
directive node contains HTML content which purpose is to be used as a template for the grid cells, at the time they will be rendered.
The problem is that, the engine "sees" and compiles, transclude the custom-directive-with-transclusion
directive before the my-datagrid
directive creates the Datagrid.
So the my datagrid-column
directive get an already compiled cell "template"...and I don't want that, I want to compile each cell myself with the $compile
service.
Maybe it is not the way to do that, maybe I'm going totally in the wrong way. I just want to avoid describing the cell template in the Javascript controller between some ugly quotes and escaping everything like :
template[0] = '<div>this is my ugly template {{myCol1}} of my first column</div>';
template[1] = '<div>this is my ugly template {{myCol2}} of the 2nd column</div>';