Is there a way to add static HTML inside generated template?
I have that code:
<test></test>
<test></test>
<script>
var app = angular.module("myApp", []);
app.directive("test", function() {
return {
template:
'<div class="wrapper">' +
'<div class="content">' +
'</div>' +
'</div>'
};
});
</script>
... And then, I want to add <p>foo</p> (see yellow note below) inside first <content>, but not inside second. So, the output should be:
<test>
<div class="wrapper">
<div class="content">
foo
</div>
</div>
</test>
<test>
<div class="wrapper">
<div class="content">
</div>
</div>
</test>
How I can do it?
jsFiddle as aksed in the comments.
Note: This is just SO example. In the real code, it should be added more complex HTML markup, not simple
<p>foo</p>. For example, it may be added something like:<div class="..."><p>...</p><p>...</p></div>. Or, maybe, some HTML table. That is what I want.