mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-10 22:44:01 +08:00
test(controller): instantiate controller defined on window
Just adding a missing spec.
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user