fix(compiler): support string tokens with . inside.

This commit is contained in:
Tobias Bosch
2016-04-21 11:17:49 -07:00
parent 386cc5dbb6
commit cc86fee1d1
2 changed files with 15 additions and 2 deletions

View File

@ -92,6 +92,17 @@ function declareTests(isJit: boolean) {
});
}));
it('should support providers with string token with a `.` in it',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var token = 'a.b';
var tokenValue = 1;
createInjector(tcb, [provide(token, {useValue: tokenValue})])
.then((injector: Injector) => {
expect(injector.get(token)).toEqual(tokenValue);
async.done();
});
}));
it('should support providers with an anonymous function',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var token = () => true;