Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 9bce926

Browse files
committed
fixup
1 parent 275b4e3 commit 9bce926

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

docs/content/guide/compiler.ngdoc

+3-6
Original file line numberDiff line numberDiff line change
@@ -459,19 +459,16 @@ In that case, it is necessary to intercept the *initial* compilation of the elem
459459
1. Give your directive the `terminal` property and a higher priority than directives
460460
that should not be compiled twice. In the example, the compiler will only compile directives
461461
which have a priority of 100 or higher.
462-
2. Inside this directive's compile function, remove the original directive attribute from the element,
463-
and add any other directive attributes. Removing the attribute is necessary, because otherwise the
464-
compilation would result in an infinite loop.
465-
3. Compile the element but restrict the maximum priority, so that any already compiled directives
466-
are not compiled twice.
462+
2. Inside this directive's compile function, add any other directive attributes to the template.
463+
3. Compile the element, but restrict the maximum priority, so that any already compiled directives
464+
(including the `addOptions` directive) are not compiled again.
467465
4. In the link function, link the compiled element with the element's scope
468466

469467
```
470468
angular.module('app').directive('addOptions', function($compile) {
471469
return {
472470
priority: 100, // ngModel has priority 1
473471
terminal: true,
474-
template: '<input ng-model="$ctrl.value">',
475472
compile: function(templateElement, templateAttributes) {
476473
templateAttributes.$set('ngModelOptions', '{debounce: 1000}');
477474

0 commit comments

Comments
 (0)