Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit 54328d7

Browse files
committed
feat(di): introduced @NgInjectableService to make di codegen easier
1 parent ea769d6 commit 54328d7

19 files changed

+37
-1
lines changed

lib/core/directive.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ abstract class NgDetachAware {
418418
void detach();
419419
}
420420

421+
@NgInjectableService()
421422
class DirectiveMap extends AnnotationMap<NgAnnotation> {
422423
DirectiveMap(Injector injector, MetadataExtractor metadataExtractor,
423424
FieldMetadataExtractor fieldMetadataExtractor)
@@ -445,6 +446,7 @@ class DirectiveMap extends AnnotationMap<NgAnnotation> {
445446
}
446447
}
447448

449+
@NgInjectableService()
448450
class FieldMetadataExtractor {
449451
List<TypeMirror> _fieldAnnotations = [reflectType(NgAttr),
450452
reflectType(NgOneWay), reflectType(NgOneWayOneTime),

lib/core/exception_handler.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ part of angular.core;
77
* In your application it is expected that this service is overridden with
88
* your implementation which can store the exception for later processing.
99
*/
10+
@NgInjectableService()
1011
class ExceptionHandler {
1112

1213
/**

lib/core/filter.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class NgFilter {
3737
/**
3838
* Registry of filters at runtime.
3939
*/
40+
@NgInjectableService()
4041
class FilterMap extends AnnotationMap<NgFilter> {
4142
Injector _injector;
4243
FilterMap(Injector injector, MetadataExtractor extractMetadata) : super(injector, extractMetadata) {

lib/core/interpolate.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class Interpolation {
3434
* var exp = $interpolate('Hello {{name}}!');
3535
* expect(exp({name:'Angular'}).toEqual('Hello Angular!');
3636
*/
37+
@NgInjectableService()
3738
class Interpolate {
3839
final Parser _parse;
3940

lib/core/module.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import 'package:perf_api/perf_api.dart';
1111
import 'package:angular/core/parser/parser_library.dart';
1212
import 'package:angular/utils.dart';
1313

14+
import 'service.dart';
15+
export 'service.dart';
1416

1517
part "cache.dart";
1618
part "directive.dart";

lib/core/parser/backend.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class Expression implements ParserAST {
2424
get assignable => assign != null;
2525
}
2626

27+
@NgInjectableService()
2728
class GetterSetter {
2829
static stripTrailingNulls(List l) {
2930
while (l.length > 0 && l.last == null) {
@@ -87,6 +88,7 @@ class GetterSetter {
8788

8889
var undefined_ = const Symbol("UNDEFINED");
8990

91+
@NgInjectableService()
9092
class ParserBackend {
9193
GetterSetter _getterSetter;
9294
FilterMap _filters;

lib/core/parser/lexer.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
part of angular.core.parser;
22

3+
@NgInjectableService()
34
class Lexer {
45
static const String QUOTES = "\"'";
56
static const String DOT = ".";

lib/core/parser/parser.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ Map<String, Operator> OPERATORS = {
133133
'?': (s, l, c, t, f) => toBool(c.eval(s, l)) ? t.eval(s, l) : f.eval(s, l),
134134
};
135135

136+
@NgInjectableService()
136137
class DynamicParser implements Parser {
137138
final Lexer _lexer;
138139
final ParserBackend _b;

lib/core/parser/static_parser.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class StaticParserFunctions {
66
Map<String, dynamic> functions;
77
}
88

9+
@NgInjectableService()
910
class StaticParser implements Parser {
1011
Map<String, dynamic> _functions;
1112
Parser _fallbackParser;

lib/core/registry.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ abstract class AnnotationMap<K> {
3939
}
4040
}
4141

42+
@NgInjectableService()
4243
class MetadataExtractor {
4344

4445
Iterable call(Type type) {

0 commit comments

Comments
 (0)