June 2014
Intermediate to advanced
696 pages
38h 52m
English
You can add a directive template as a child to the AngularJS template element where you define it, or you can replace it by using the replace attribute. To illustrate this, look at the following directive:
directive('myDirective', function() { return { replace: true, templateUrl: '<div>directive</div>' };});
Then look at the following template code:
<div> <span my-directive></span></div>
The compiler sees that replace is true and replaces the inner <span> element as shown below:
<div> <div>directive</div></div>
Read now
Unlock full access