This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree 3 files changed +39
-26
lines changed
test/io/test_files/templates
3 files changed +39
-26
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,15 @@ class TemplateCollectingVisitor {
118
118
TemplateCollectingVisitor (this .templates, this .blacklistedClasses,
119
119
this .sourceCrawler);
120
120
121
- call (CompilationUnitElement cue, String srcPath) {
121
+ void call (CompilationUnitElement cue, String srcPath) {
122
+ processDeclarations (cue, srcPath);
123
+
124
+ cue.enclosingElement.parts.forEach ((CompilationUnitElement part) {
125
+ processDeclarations (part, srcPath);
126
+ });
127
+ }
128
+
129
+ void processDeclarations (CompilationUnitElement cue, String srcPath) {
122
130
CompilationUnit cu = sourceCrawler.context
123
131
.resolveCompilationUnit (cue.source, cue.library);
124
132
cu.declarations.forEach ((CompilationUnitMember declaration) {
@@ -166,8 +174,7 @@ class TemplateCollectingVisitor {
166
174
});
167
175
}
168
176
169
- bool extractNgTemplateCache (
170
- Annotation ann, List <String > cacheUris) {
177
+ bool extractNgTemplateCache (Annotation ann, List <String > cacheUris) {
171
178
bool cache = true ;
172
179
ann.arguments.arguments.forEach ((Expression arg) {
173
180
if (arg is NamedExpression ) {
Original file line number Diff line number Diff line change @@ -3,27 +3,7 @@ library test_files.main;
3
3
import 'package:angular/core/module.dart' ;
4
4
import 'package:angular/tools/template_cache_annotation.dart' ;
5
5
6
- @NgComponent (
7
- selector: 'my-component' ,
8
- templateUrl: '/test/io/test_files/templates/main.html' )
9
- @NgTemplateCache ()
10
- class MyComponent
11
- {
12
- }
6
+ part 'partial.dart' ;
13
7
14
- @NgComponent (
15
- selector: 'my-component2' ,
16
- templateUrl: '/test/io/test_files/templates/dont.html' )
17
- @NgTemplateCache (cache: false )
18
- class MyComponent2
19
- {
20
- }
21
-
22
-
23
- @NgComponent (
24
- selector: 'my-component3' ,
25
- templateUrl: '/test/io/test_files/templates/dont.html' )
26
- @NgTemplateCache (cache: true )
27
- class MyComponent3
28
- {
29
- }
8
+ class MainClass {
9
+ }
Original file line number Diff line number Diff line change
1
+ part of 'main.dart' ;
2
+
3
+ @NgComponent (
4
+ selector: 'my-component' ,
5
+ templateUrl: '/test/io/test_files/templates/main.html' )
6
+ @NgTemplateCache ()
7
+ class MyComponent
8
+ {
9
+ }
10
+
11
+ @NgComponent (
12
+ selector: 'my-component2' ,
13
+ templateUrl: '/test/io/test_files/templates/dont.html' )
14
+ @NgTemplateCache (cache: false )
15
+ class MyComponent2
16
+ {
17
+ }
18
+
19
+
20
+ @NgComponent (
21
+ selector: 'my-component3' ,
22
+ templateUrl: '/test/io/test_files/templates/dont.html' )
23
+ @NgTemplateCache (cache: true )
24
+ class MyComponent3
25
+ {
26
+ }
You can’t perform that action at this time.
0 commit comments