diff --git a/package.json b/package.json index 6980a4f..e64a268 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ }, "dependencies": { "es6-shim": "~0.9.2", - "watchtower": "angular/watchtower.js" + "watchtower": "angular/watchtower.js", + "di": "angular/di.js" }, "devDependencies": { "gulp": "^3.5.6", diff --git a/src/parser.js b/src/parser.js index ca285e9..3f6c5bb 100644 --- a/src/parser.js +++ b/src/parser.js @@ -1,3 +1,6 @@ +// TODO(vojta): use only di-annotations +import {Inject} from 'di'; + import {Lexer,Token} from './lexer'; import {Expression,ArrayOfExpression,Chain,Filter,Assign, Conditional, AccessScope, AccessMember, AccessKeyed, @@ -6,6 +9,7 @@ import {Expression,ArrayOfExpression,Chain,Filter,Assign, var EOF = new Token(-1, null); +@Inject export class Parser { constructor(){ this.cache = {}; diff --git a/src/watch_parser.js b/src/watch_parser.js index f9515ee..732c202 100644 --- a/src/watch_parser.js +++ b/src/watch_parser.js @@ -1,3 +1,6 @@ +// TODO(vojta): use only di-annotations +import {Inject} from 'di'; + import {AST, ContextReferenceAST, CollectionAST, MethodAST, FieldReadAST, PureFunctionAST, ConstantAST} from 'watchtower'; @@ -12,6 +15,7 @@ import {Expression,ArrayOfExpression,Chain,Filter,Assign, var scopeContextRef = new ContextReferenceAST(); +@Inject export class WatchParser { constructor(parser:Parser){ this._parser = parser; diff --git a/test-main.js b/test-main.js index b4eb627..686b3c0 100644 --- a/test-main.js +++ b/test-main.js @@ -22,7 +22,8 @@ require.config({ }, map: { '*': { - 'watchtower': 'node_modules/watchtower/src/index' + 'watchtower': 'node_modules/watchtower/src/index', + 'di': 'node_modules/di/src/index' } },