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

fix(application): set injector property when bootstraping the app #1391

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/application.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 10 additions & 0 deletions test/bootstrap_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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('<div>{{"works"}}</div>');
var application = applicationFactory();
application.run();

expect(application.injector).toBeNotNull();
});
});
});
}