Skip to content

Commit fb67e37

Browse files
committed
feat(decorators): adds decorators to be used by TS and Babel transpiled apps.
1 parent 648c514 commit fb67e37

File tree

116 files changed

+2833
-1643
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+2833
-1643
lines changed

gulpfile.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,10 +647,13 @@ gulp.task('bundle.js.min.deps', ['bundle.js.min'], function() {
647647
.pipe(gulp.dest('dist/bundle'));
648648
});
649649

650-
var JS_DEV_DEPS = ['node_modules/zone.js/zone.js', 'node_modules/zone.js/long-stack-trace-zone.js'];
650+
var JS_DEV_DEPS = ['node_modules/zone.js/zone.js',
651+
'node_modules/zone.js/long-stack-trace-zone.js',
652+
'node_modules/reflect-metadata/Reflect.js'];
651653

652654
gulp.task('bundle.js.dev.deps', ['bundle.js.dev'], function() {
653655
return bundler.modify(JS_DEV_DEPS.concat(['dist/build/angular2.dev.js']), 'angular2.dev.js')
656+
.pipe(insert.append('\nSystem.config({"paths":{"*":"*.js","angular2/*":"angular2/*"}});\n'))
654657
.pipe(insert.append('\nzone = zone.fork(Zone.longStackTraceZone);\n'))
655658
.pipe(gulp.dest('dist/bundle'));
656659
});

karma-js.conf.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module.exports = function(config) {
1919
'node_modules/systemjs/lib/extension-register.js',
2020
'node_modules/systemjs/lib/extension-cjs.js',
2121
'node_modules/rx/dist/rx.all.js',
22+
'node_modules/reflect-metadata/Reflect.js',
2223
'node_modules/zone.js/zone.js',
2324
'node_modules/zone.js/long-stack-trace-zone.js',
2425

modules/angular2/annotations.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
*
1010
*/
1111
export * from './src/core/annotations/annotations';
12+
export * from './src/core/decorators/decorators';

modules/angular2/globals.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ interface Window {
2121
assert: typeof assert;
2222
NaN: typeof NaN;
2323
gc(): void;
24+
Reflect: any;
2425
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* This indirection is needed for TS compilation path.
3+
* See comment in annotations.es6.
4+
*/
5+
6+
library angular2.core.annotations.annotations;
7+
8+
export "../annotations_impl/annotations.dart";
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* This indirection is needed to free up Component, etc symbols in the public API
3+
* to be used by the decorator versions of these annotations.
4+
*/
5+
6+
export {
7+
Component as ComponentAnnotation,
8+
Decorator as DecoratorAnnotation,
9+
Directive as DirectiveAnnotation,
10+
DynamicComponent as DynamicComponentAnnotation,
11+
Viewport as ViewportAnnotation,
12+
onDestroy, onChange, onAllChangesDone
13+
} from '../annotations_impl/annotations';
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
library angular2.core.annotations.di;
2+
3+
export "../annotations_impl/di.dart";
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export {
2+
Query as QueryAnnotation,
3+
Attribute as AttributeAnnotation,
4+
} from '../annotations_impl/di';
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
library angular2.core.annotations.view;
2+
3+
export "../annotations_impl/view.dart";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export {
2+
View as ViewAnnotation,
3+
} from '../annotations_impl/view';

0 commit comments

Comments
 (0)