Consider this code
my_app.run( [ '$templateCache' , function( $templateCache ) { var template = "" + "{{ item.name }}" + "<ul ng-if='item.sub'>" + "<li ng-repeat='item in item.sub' ng-include=\"'angular-multi-select-item.htm'\"></li>" + "</ul>" + ""; $templateCache.put( 'angular-multi-select-item.htm' , template ); }]); While this works as expected, I see it quite ugly (the concatenated string with html inside). Is there some other, more clean, way to define the html for an Angular template?