This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ part 'block_type.dart';
13
13
part 'compiler.dart' ;
14
14
part 'directive.dart' ;
15
15
part 'directives/ng_bind.dart' ;
16
+ part 'directives/ng_cloak.dart' ;
16
17
part 'directives/ng_click.dart' ;
17
18
part 'directives/ng_controller.dart' ;
18
19
part 'directives/ng_mustache.dart' ;
@@ -125,6 +126,7 @@ angularModule(AngularModule module) {
125
126
126
127
module.directive (NgBindAttrDirective );
127
128
module.directive (NgRepeatAttrDirective );
129
+ module.directive (NgCloakAttrDirective );
128
130
module.directive (NgClickAttrDirective );
129
131
module.directive (NgControllerAttrDirective );
130
132
}
Original file line number Diff line number Diff line change
1
+ part of angular;
2
+
3
+
4
+ class NgCloakAttrDirective {
5
+ dom.Element node;
6
+
7
+ NgCloakAttrDirective (dom.Node this .node) {}
8
+
9
+ attach (Scope scope) {
10
+ node.attributes.remove ('ng-cloak' );
11
+ }
12
+ }
Original file line number Diff line number Diff line change
1
+ import '../_specs.dart' ;
2
+ import 'dart:html' as dom;
3
+
4
+
5
+ main () {
6
+ beforeEach (module (angularModule));
7
+
8
+ describe ('NgCloak' , () {
9
+ var compile, element, rootScope;
10
+
11
+ triggerEvent (elementWrapper, name) {
12
+ elementWrapper[0 ].dispatchEvent (new dom.Event .eventType ('MouseEvent' , name));
13
+ }
14
+
15
+ beforeEach (inject ((Scope scope, Compiler compiler) {
16
+ compile = (html, [applyFn]) {
17
+ element = $(html);
18
+ rootScope = scope;
19
+ compiler (element)(element).attach (scope);
20
+ scope.$apply (applyFn);
21
+ };
22
+ }));
23
+
24
+
25
+ it ('should remove ng-cloak when compiled' , () {
26
+ compile ('<div><span ng-cloak></span></div>' );
27
+ expect (element.html ()).toEqual ('<span></span>' );
28
+ });
29
+ });
30
+ }
You can’t perform that action at this time.
0 commit comments