@@ -10,25 +10,25 @@ class LogAttrDirective {
10
10
attach (Scope scope) {}
11
11
}
12
12
13
- class ReplaceAttrDirective {
13
+ class ReplaceComponent {
14
14
static String $template = '<div log="REPLACE" style="width: 10px" high-log>Replace!</div>' ;
15
15
static var $replace = true ;
16
- ReplaceAttrDirective (Node node) {
16
+ ReplaceComponent (Node node) {
17
17
node.attributes['compiled' ] = 'COMPILED' ;
18
18
}
19
19
attach (Scope scope) {}
20
20
}
21
21
22
- class ReplacetwoAttrDirective {
22
+ class ReplacetwoComponent {
23
23
static String $template = '<div log="REPLACE" style="width: 10px" high-log>Re<div>place!</div></div>' ;
24
24
static var $replace = true ;
25
- ReplaceAttrDirective (Node node) {
25
+ ReplaceComponent (Node node) {
26
26
node.attributes['compiled' ] = 'COMPILED' ;
27
27
}
28
28
attach (Scope scope) {}
29
29
}
30
30
31
- class ShadowtranscludeAttrDirective {
31
+ class ShadowtranscludeComponent {
32
32
static String $template = '<div log="REPLACE" style="width: 10px" high-log>Replace!<content>SHADOW-CONTENT</content></div>' ;
33
33
static var $replace = true ;
34
34
ShadowtranscludeDirective (Node node) {
@@ -45,36 +45,35 @@ class AppendAttrDirective {
45
45
}
46
46
47
47
main () {
48
- xdescribe ('template' , () {
48
+ describe ('template' , () {
49
49
var element, directive, $compile, $rootScope;
50
50
51
51
beforeEach (inject ((Injector injector) {
52
52
element = null ;
53
53
injector.get (DirectiveRegistry )
54
54
..register (LogAttrDirective )
55
- ..register (ReplaceAttrDirective )
56
- ..register (ReplacetwoAttrDirective )
57
- ..register (ShadowtranscludeAttrDirective )
58
- ..register (NgShadowDomAttrDirective );
55
+ ..register (ReplaceComponent )
56
+ ..register (ReplacetwoComponent )
57
+ ..register (ShadowtranscludeComponent );
59
58
}));
60
59
61
60
62
61
it ('should replace element with template' , inject ((Compiler $compile, Scope $rootScope, Log log) {
63
- var element = $('<div><div replace log>ignore</div ><div>' );
62
+ var element = $('<div><replace log>ignore</replace ><div>' );
64
63
$compile (element)(element)..attach ($rootScope);
65
64
expect (renderedText (element)).toEqual ('Replace!' );
66
65
expect (log.result ()).toEqual ('REPLACE; LOG' );
67
66
}));
68
67
69
68
it ('should replacetwo element with template' , inject ((Compiler $compile, Scope $rootScope, Log log) {
70
- var element = $('<div><div replacetwo log>ignore</div ><div>' );
69
+ var element = $('<div><replacetwo log>ignore</replacetwo ><div>' );
71
70
$compile (element)(element)..attach ($rootScope);
72
71
expect (renderedText (element)).toEqual ('Replace!' );
73
72
expect (log.result ()).toEqual ('REPLACE; LOG' );
74
73
}));
75
74
76
75
it ('should support transclusion within the template' , inject ((Compiler $compile, Scope $rootScope, Log log) {
77
- var element = $('<div><div shadowtransclude log>transcluded</div ><div>' );
76
+ var element = $('<div><shadowtransclude log>transcluded</shadowtransclude ><div>' );
78
77
$compile (element)(element)..attach ($rootScope);
79
78
expect (renderedText (element)).toEqual ('Replace!transcluded' );
80
79
expect (log.result ()).toEqual ('REPLACE; LOG' );
0 commit comments