mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
test(controller): instantiate controller defined on window
Just adding a missing spec.
This commit is contained in:
parent
de2cdb0658
commit
e295eeefaa
1 changed files with 12 additions and 0 deletions
|
|
@ -90,6 +90,18 @@ describe('$controller', function() {
|
|||
});
|
||||
|
||||
|
||||
it('should instantiate controller defined on window', inject(function($window) {
|
||||
var scope = {};
|
||||
var Foo = function() {};
|
||||
|
||||
$window.a = {Foo: Foo};
|
||||
|
||||
var foo = $controller('a.Foo', {$scope: scope});
|
||||
expect(foo).toBeDefined();
|
||||
expect(foo instanceof Foo).toBe(true);
|
||||
}));
|
||||
|
||||
|
||||
describe('ctrl as syntax', function() {
|
||||
|
||||
it('should publish controller instance into scope', function() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue