@@ -174,6 +174,24 @@ describe('component', function() {
174
174
} ) ;
175
175
} ) ;
176
176
177
+ it ( 'should allow passing injectable arrays as template/templateUrl' , function ( ) {
178
+ var log = '' ;
179
+ window . angular . module ( 'my' , [ ] ) . component ( 'myComponent' , {
180
+ template : [ '$element' , '$attrs' , 'myValue' , function ( $element , $attrs , myValue ) {
181
+ log += 'template,' + $element + ',' + $attrs + ',' + myValue + '\n' ;
182
+ } ] ,
183
+ templateUrl : [ '$element' , '$attrs' , 'myValue' , function ( $element , $attrs , myValue ) {
184
+ log += 'templateUrl,' + $element + ',' + $attrs + ',' + myValue + '\n' ;
185
+ } ]
186
+ } ) . value ( 'myValue' , 'blah' ) ;
187
+ module ( 'my' ) ;
188
+ inject ( function ( myComponentDirective ) {
189
+ myComponentDirective [ 0 ] . template ( 'a' , 'b' ) ;
190
+ myComponentDirective [ 0 ] . templateUrl ( 'c' , 'd' ) ;
191
+ expect ( log ) . toEqual ( 'template,a,b,blah\ntemplateUrl,c,d,blah\n' ) ;
192
+ } ) ;
193
+ } ) ;
194
+
177
195
it ( 'should allow passing transclude as object' , function ( ) {
178
196
window . angular . module ( 'my' , [ ] ) . component ( 'myComponent' , {
179
197
transclude : { }
0 commit comments