@@ -17,8 +17,8 @@ describe('$controller', function() {
1717
1818 it ( 'should allow registration of controllers' , function ( ) {
1919 var FooCtrl = function ( $scope ) { $scope . foo = 'bar' } ,
20- scope = { } ,
21- ctrl ;
20+ scope = { } ,
21+ ctrl ;
2222
2323 $controllerProvider . register ( 'FooCtrl' , FooCtrl ) ;
2424 ctrl = $controller ( 'FooCtrl' , { $scope : scope } ) ;
@@ -28,6 +28,24 @@ describe('$controller', function() {
2828 } ) ;
2929
3030
31+ it ( 'should allow registration of map of controllers' , function ( ) {
32+ var FooCtrl = function ( $scope ) { $scope . foo = 'foo' } ,
33+ BarCtrl = function ( $scope ) { $scope . bar = 'bar' } ,
34+ scope = { } ,
35+ ctrl ;
36+
37+ $controllerProvider . register ( { FooCtrl : FooCtrl , BarCtrl : BarCtrl } ) ;
38+
39+ ctrl = $controller ( 'FooCtrl' , { $scope : scope } ) ;
40+ expect ( scope . foo ) . toBe ( 'foo' ) ;
41+ expect ( ctrl instanceof FooCtrl ) . toBe ( true ) ;
42+
43+ ctrl = $controller ( 'BarCtrl' , { $scope : scope } ) ;
44+ expect ( scope . bar ) . toBe ( 'bar' ) ;
45+ expect ( ctrl instanceof BarCtrl ) . toBe ( true ) ;
46+ } ) ;
47+
48+
3149 it ( 'should allow registration of controllers annotated with arrays' , function ( ) {
3250 var FooCtrl = function ( $scope ) { $scope . foo = 'bar' } ,
3351 scope = { } ,
0 commit comments