Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit e295eee

Browse files
committed
test(controller): instantiate controller defined on window
Just adding a missing spec.
1 parent de2cdb0 commit e295eee

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/ng/controllerSpec.js

+12
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,18 @@ describe('$controller', function() {
9090
});
9191

9292

93+
it('should instantiate controller defined on window', inject(function($window) {
94+
var scope = {};
95+
var Foo = function() {};
96+
97+
$window.a = {Foo: Foo};
98+
99+
var foo = $controller('a.Foo', {$scope: scope});
100+
expect(foo).toBeDefined();
101+
expect(foo instanceof Foo).toBe(true);
102+
}));
103+
104+
93105
describe('ctrl as syntax', function() {
94106

95107
it('should publish controller instance into scope', function() {

0 commit comments

Comments
 (0)