@@ -231,12 +231,12 @@ describe('$compile', function() {
231
231
directive ( 'ff' , function ( log ) {
232
232
var declaration = {
233
233
restrict : 'E' ,
234
- template : function ( ) {
234
+ template : function ( ) {
235
235
log ( 'ff template: ' + ( this === declaration ) ) ;
236
236
} ,
237
- compile : function ( ) {
237
+ compile : function ( ) {
238
238
log ( 'ff compile: ' + ( this === declaration ) ) ;
239
- return function ( ) {
239
+ return function ( ) {
240
240
log ( 'ff post: ' + ( this === declaration ) ) ;
241
241
} ;
242
242
}
@@ -248,10 +248,10 @@ describe('$compile', function() {
248
248
var declaration = {
249
249
restrict : 'E' ,
250
250
link : {
251
- pre : function ( ) {
251
+ pre : function ( ) {
252
252
log ( 'fff pre: ' + ( this === declaration ) ) ;
253
253
} ,
254
- post : function ( ) {
254
+ post : function ( ) {
255
255
log ( 'fff post: ' + ( this === declaration ) ) ;
256
256
}
257
257
}
@@ -262,12 +262,12 @@ describe('$compile', function() {
262
262
directive ( 'ffff' , function ( log ) {
263
263
var declaration = {
264
264
restrict : 'E' ,
265
- compile : function ( ) {
265
+ compile : function ( ) {
266
266
return {
267
- pre : function ( ) {
267
+ pre : function ( ) {
268
268
log ( 'ffff pre: ' + ( this === declaration ) ) ;
269
269
} ,
270
- post : function ( ) {
270
+ post : function ( ) {
271
271
log ( 'ffff post: ' + ( this === declaration ) ) ;
272
272
}
273
273
} ;
@@ -279,39 +279,37 @@ describe('$compile', function() {
279
279
directive ( 'fffff' , function ( log ) {
280
280
var declaration = {
281
281
restrict : 'E' ,
282
- templateUrl : function ( ) {
283
- log ( 'fffff: ' + ( this === declaration ) ) ;
284
- }
285
- } ;
286
- return declaration ;
287
- } ) ;
288
-
289
- directive ( 'ffffff' , function ( log ) {
290
- var declaration = {
291
- restrict : 'E' ,
292
- link : function ( ) {
293
- log ( 'ffffff: ' + ( this === declaration ) ) ;
282
+ templateUrl : function ( ) {
283
+ log ( 'fffff templateUrl: ' + ( this === declaration ) ) ;
284
+ return 'fffff.html' ;
285
+ } ,
286
+ link : function ( ) {
287
+ log ( 'fffff post: ' + ( this === declaration ) ) ;
294
288
}
295
289
} ;
296
290
return declaration ;
297
291
} ) ;
298
292
} ) ;
299
- inject ( function ( $compile , $rootScope , log ) {
293
+
294
+ inject ( function ( $compile , $rootScope , $templateCache , log ) {
295
+ $templateCache . put ( 'fffff.html' , '' ) ;
296
+
300
297
$compile ( '<ff></ff>' ) ( $rootScope ) ;
301
298
$compile ( '<fff></fff>' ) ( $rootScope ) ;
302
299
$compile ( '<ffff></ffff>' ) ( $rootScope ) ;
303
300
$compile ( '<fffff></fffff>' ) ( $rootScope ) ;
304
- $compile ( '<ffffff></ffffff>' ) ( $rootScope ) ;
301
+ $rootScope . $digest ( ) ;
302
+
305
303
expect ( log ) . toEqual (
306
- 'ff template: true; ' +
307
- 'ff compile: true; ' +
308
- 'ff post: true; ' +
309
- 'fff pre: true; ' +
310
- 'fff post: true; ' +
311
- 'ffff pre: true; ' +
312
- 'ffff post: true; ' +
313
- 'fffff: true; ' +
314
- 'ffffff : true'
304
+ 'ff template: true; ' +
305
+ 'ff compile: true; ' +
306
+ 'ff post: true; ' +
307
+ 'fff pre: true; ' +
308
+ 'fff post: true; ' +
309
+ 'ffff pre: true; ' +
310
+ 'ffff post: true; ' +
311
+ 'fffff templateUrl : true; ' +
312
+ 'fffff post : true'
315
313
) ;
316
314
} ) ;
317
315
} ) ;
0 commit comments