In this document: http://docs.angularjs.org/guide/directive , it says that there is a replace
configuration for directives:
templ
You are getting confused with transclude: true
, which would append the inner content.
http://plnkr.co/edit/k9qSx15fhSZRMwgAIMP4?p=preview For example without and with As you can see in the latter example, the div tag is indeed replaced.replace: true
means that the content of the directive template will replace the element that the directive is declared on, in this case the replace:true
replace:true
directive template1