You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/error/compile/tplrt.ngdoc
+12-5
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,16 @@
3
3
@fullName Invalid Template Root
4
4
@description
5
5
6
-
When a directive is declared with `template` (or `templateUrl`) and `replace` mode on, the template must have exactly one root element.
7
-
That is, the text of the template property or the content referenced by the templateUrl must be contained within a single html element.
6
+
When a directive is declared with `template` (or `templateUrl`) and `replace` mode on, the template
7
+
must have exactly one root element. That is, the text of the template property or the content
8
+
referenced by the templateUrl must be contained within a single html element.
8
9
For example, '<p>blah <em>blah</em> blah</p>' instead of simply 'blah <em>blah</em> blah'.
9
-
Otherwise, the replacement operation would result in a single element (the directive) being replaced with multiple elements or nodes, which is unsupported and not commonly needed in practice.
10
+
Otherwise, the replacement operation would result in a single element (the directive) being replaced
11
+
with multiple elements or nodes, which is unsupported and not commonly needed in practice.
10
12
11
13
12
14
For example a directive with definition:
15
+
13
16
```
14
17
myModule.directive('myDirective', function factory() {
15
18
return {
@@ -21,12 +24,16 @@ myModule.directive('myDirective', function factory() {
21
24
});
22
25
```
23
26
24
-
And a template provided at URL `someUrl`. The template must be an html fragment that has only a single root element, like the `div` element in this template:
27
+
And a template provided at URL `someUrl`. The template must be an html fragment that has only a
28
+
single root element, like the `div` element in this template:
29
+
25
30
```
26
31
<div><b>Hello</b> World!</div>
27
32
```
28
33
29
-
An an invalid template to be used with this directive is one that defines multiple root nodes or elements. For example:
34
+
An an invalid template to be used with this directive is one that defines multiple root nodes or
0 commit comments