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

Commit e1607ce

Browse files
vsavkinjbdeboer
authored andcommitted
fix(application): set injector property when bootstraping the app
Closes #1391
1 parent 9a92f68 commit e1607ce

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/application.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ abstract class Application {
179179
publishToJavaScript();
180180
return zone.run(() {
181181
var rootElements = [element];
182-
Injector injector = createInjector();
182+
injector = createInjector();
183183
ExceptionHandler exceptionHandler = injector.getByKey(EXCEPTION_HANDLER_KEY);
184184
// Publish cache register interface
185185
injector.getByKey(JS_CACHE_REGISTER_KEY);

test/bootstrap_spec.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,15 @@ void main() {
3030
applicationFactory()..selector('div[ng-bind]')..run();
3131
expect(body.text).toEqual('{{ignor me}}works');
3232
});
33+
34+
describe("run", () {
35+
it("should set the injector property", () {
36+
var body = setBody('<div>{{"works"}}</div>');
37+
var application = applicationFactory();
38+
application.run();
39+
40+
expect(application.injector).toBeNotNull();
41+
});
42+
});
3343
});
3444
}

0 commit comments

Comments
 (0)