From 3a8562cf90c9fbd309d613401fd77d3225281339 Mon Sep 17 00:00:00 2001 From: vsavkin Date: Tue, 26 Aug 2014 10:20:18 -0400 Subject: [PATCH] fix(application): set injector property when bootstraping the app --- lib/application.dart | 2 +- test/bootstrap_spec.dart | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/application.dart b/lib/application.dart index 3773e4284..8c7414305 100644 --- a/lib/application.dart +++ b/lib/application.dart @@ -179,7 +179,7 @@ abstract class Application { publishToJavaScript(); return zone.run(() { var rootElements = [element]; - Injector injector = createInjector(); + injector = createInjector(); ExceptionHandler exceptionHandler = injector.getByKey(EXCEPTION_HANDLER_KEY); // Publish cache register interface injector.getByKey(JS_CACHE_REGISTER_KEY); diff --git a/test/bootstrap_spec.dart b/test/bootstrap_spec.dart index fd6b147b8..b59bba34d 100644 --- a/test/bootstrap_spec.dart +++ b/test/bootstrap_spec.dart @@ -30,5 +30,15 @@ void main() { applicationFactory()..selector('div[ng-bind]')..run(); expect(body.text).toEqual('{{ignor me}}works'); }); + + describe("run", () { + it("should set the injector property", () { + var body = setBody('
{{"works"}}
'); + var application = applicationFactory(); + application.run(); + + expect(application.injector).toBeNotNull(); + }); + }); }); }