@@ -39,7 +39,7 @@ describe('ngView', function() {
3939 } ;
4040 } ) ;
4141
42- $routeProvider . when ( '/some' , { template : '/tpl.html' , controller : Ctrl } ) ;
42+ $routeProvider . when ( '/some' , { templateUrl : '/tpl.html' , controller : Ctrl } ) ;
4343 } ) ;
4444
4545 inject ( function ( $route , $rootScope , $templateCache , $location ) {
@@ -59,7 +59,7 @@ describe('ngView', function() {
5959
6060 module ( function ( $controllerProvider , $routeProvider ) {
6161 $controllerProvider . register ( 'MyCtrl' , [ '$scope' , MyCtrl ] ) ;
62- $routeProvider . when ( '/foo' , { controller : 'MyCtrl' , template : '/tpl.html' } ) ;
62+ $routeProvider . when ( '/foo' , { controller : 'MyCtrl' , templateUrl : '/tpl.html' } ) ;
6363 } ) ;
6464
6565 inject ( function ( $route , $location , $rootScope , $templateCache ) {
@@ -75,8 +75,8 @@ describe('ngView', function() {
7575
7676 it ( 'should load content via xhr when route changes' , function ( ) {
7777 module ( function ( $routeProvider ) {
78- $routeProvider . when ( '/foo' , { template : 'myUrl1' } ) ;
79- $routeProvider . when ( '/bar' , { template : 'myUrl2' } ) ;
78+ $routeProvider . when ( '/foo' , { templateUrl : 'myUrl1' } ) ;
79+ $routeProvider . when ( '/bar' , { templateUrl : 'myUrl2' } ) ;
8080 } ) ;
8181
8282 inject ( function ( $rootScope , $compile , $httpBackend , $location , $route ) {
@@ -97,9 +97,34 @@ describe('ngView', function() {
9797 } ) ;
9898
9999
100+ it ( 'should use inline content route changes' , function ( ) {
101+ module ( function ( $routeProvider ) {
102+ $routeProvider . when ( '/foo' , { template : '<div>{{1+3}}</div>' } ) ;
103+ $routeProvider . when ( '/bar' , { template : 'angular is da best' } ) ;
104+ $routeProvider . when ( '/blank' , { template : '' } ) ;
105+ } ) ;
106+
107+ inject ( function ( $rootScope , $compile , $location , $route ) {
108+ expect ( element . text ( ) ) . toEqual ( '' ) ;
109+
110+ $location . path ( '/foo' ) ;
111+ $rootScope . $digest ( ) ;
112+ expect ( element . text ( ) ) . toEqual ( '4' ) ;
113+
114+ $location . path ( '/bar' ) ;
115+ $rootScope . $digest ( ) ;
116+ expect ( element . text ( ) ) . toEqual ( 'angular is da best' ) ;
117+
118+ $location . path ( '/blank' ) ;
119+ $rootScope . $digest ( ) ;
120+ expect ( element . text ( ) ) . toEqual ( '' ) ;
121+ } ) ;
122+ } ) ;
123+
124+
100125 it ( 'should remove all content when location changes to an unknown route' , function ( ) {
101126 module ( function ( $routeProvider ) {
102- $routeProvider . when ( '/foo' , { template : 'myUrl1' } ) ;
127+ $routeProvider . when ( '/foo' , { templateUrl : 'myUrl1' } ) ;
103128 } ) ;
104129
105130 inject ( function ( $rootScope , $compile , $location , $httpBackend , $route ) {
@@ -118,7 +143,7 @@ describe('ngView', function() {
118143
119144 it ( 'should chain scopes and propagate evals to the child scope' , function ( ) {
120145 module ( function ( $routeProvider ) {
121- $routeProvider . when ( '/foo' , { template : 'myUrl1' } ) ;
146+ $routeProvider . when ( '/foo' , { templateUrl : 'myUrl1' } ) ;
122147 } ) ;
123148
124149 inject ( function ( $rootScope , $compile , $location , $httpBackend , $route ) {
@@ -140,7 +165,7 @@ describe('ngView', function() {
140165 it ( 'should be possible to nest ngView in ngInclude' , function ( ) {
141166
142167 module ( function ( $routeProvider ) {
143- $routeProvider . when ( '/foo' , { template : 'viewPartial.html' } ) ;
168+ $routeProvider . when ( '/foo' , { templateUrl : 'viewPartial.html' } ) ;
144169 } ) ;
145170
146171 inject ( function ( $httpBackend , $location , $route , $compile , $rootScope ) {
@@ -156,7 +181,7 @@ describe('ngView', function() {
156181 $httpBackend . flush ( ) ;
157182
158183 expect ( elm . text ( ) ) . toEqual ( 'include: view: content' ) ;
159- expect ( $route . current . template ) . toEqual ( 'viewPartial.html' ) ;
184+ expect ( $route . current . templateUrl ) . toEqual ( 'viewPartial.html' ) ;
160185 dealoc ( elm )
161186 } ) ;
162187 } ) ;
@@ -170,7 +195,7 @@ describe('ngView', function() {
170195 }
171196
172197 module ( function ( $routeProvider ) {
173- $routeProvider . when ( '/foo' , { controller : ParentCtrl , template : 'viewPartial.html' } ) ;
198+ $routeProvider . when ( '/foo' , { controller : ParentCtrl , templateUrl : 'viewPartial.html' } ) ;
174199 } ) ;
175200
176201
@@ -209,8 +234,8 @@ describe('ngView', function() {
209234 // this is a test for a bad race condition that affected feedback
210235
211236 module ( function ( $routeProvider ) {
212- $routeProvider . when ( '/foo' , { template : 'myUrl1' } ) ;
213- $routeProvider . when ( '/bar' , { template : 'myUrl2' } ) ;
237+ $routeProvider . when ( '/foo' , { templateUrl : 'myUrl1' } ) ;
238+ $routeProvider . when ( '/bar' , { templateUrl : 'myUrl2' } ) ;
214239 } ) ;
215240
216241 inject ( function ( $route , $rootScope , $location , $httpBackend ) {
@@ -231,7 +256,7 @@ describe('ngView', function() {
231256
232257 it ( 'should be async even if served from cache' , function ( ) {
233258 module ( function ( $routeProvider ) {
234- $routeProvider . when ( '/foo' , { controller : noop , template : 'myUrl1' } ) ;
259+ $routeProvider . when ( '/foo' , { controller : noop , templateUrl : 'myUrl1' } ) ;
235260 } ) ;
236261
237262 inject ( function ( $route , $rootScope , $location , $templateCache ) {
@@ -262,7 +287,7 @@ describe('ngView', function() {
262287 } ;
263288
264289 module ( function ( $routeProvider ) {
265- $routeProvider . when ( '/foo' , { template : 'tpl.html' , controller : Ctrl } ) ;
290+ $routeProvider . when ( '/foo' , { templateUrl : 'tpl.html' , controller : Ctrl } ) ;
266291 } ) ;
267292
268293 inject ( function ( $templateCache , $rootScope , $location ) {
@@ -282,7 +307,7 @@ describe('ngView', function() {
282307
283308 it ( 'should destroy previous scope' , function ( ) {
284309 module ( function ( $routeProvider ) {
285- $routeProvider . when ( '/foo' , { template : 'tpl.html' } ) ;
310+ $routeProvider . when ( '/foo' , { templateUrl : 'tpl.html' } ) ;
286311 } ) ;
287312
288313 inject ( function ( $templateCache , $rootScope , $location ) {
@@ -319,8 +344,8 @@ describe('ngView', function() {
319344 } ;
320345
321346 module ( function ( $routeProvider ) {
322- $routeProvider . when ( '/one' , { template : 'one.html' , controller : createCtrl ( 'ctrl1' ) } ) ;
323- $routeProvider . when ( '/two' , { template : 'two.html' , controller : createCtrl ( 'ctrl2' ) } ) ;
347+ $routeProvider . when ( '/one' , { templateUrl : 'one.html' , controller : createCtrl ( 'ctrl1' ) } ) ;
348+ $routeProvider . when ( '/two' , { templateUrl : 'two.html' , controller : createCtrl ( 'ctrl2' ) } ) ;
324349 } ) ;
325350
326351 inject ( function ( $httpBackend , $rootScope , $location ) {
@@ -368,9 +393,9 @@ describe('ngView', function() {
368393 }
369394
370395 module ( function ( $routeProvider ) {
371- $routeProvider . when ( '/bar' , { template : 'tpl.html' , controller : createController ( 'bar' ) } ) ;
396+ $routeProvider . when ( '/bar' , { templateUrl : 'tpl.html' , controller : createController ( 'bar' ) } ) ;
372397 $routeProvider . when ( '/foo' , {
373- template : 'tpl.html' , controller : createController ( 'foo' ) , reloadOnSearch : false } ) ;
398+ templateUrl : 'tpl.html' , controller : createController ( 'foo' ) , reloadOnSearch : false } ) ;
374399 } ) ;
375400
376401 inject ( function ( $templateCache , $location , $rootScope ) {
@@ -393,7 +418,7 @@ describe('ngView', function() {
393418
394419 it ( 'should evaluate onload expression after linking the content' , function ( ) {
395420 module ( function ( $routeProvider ) {
396- $routeProvider . when ( '/foo' , { template : 'tpl.html' } ) ;
421+ $routeProvider . when ( '/foo' , { templateUrl : 'tpl.html' } ) ;
397422 } ) ;
398423
399424 inject ( function ( $templateCache , $location , $rootScope ) {
@@ -414,7 +439,7 @@ describe('ngView', function() {
414439 }
415440
416441 module ( function ( $routeProvider ) {
417- $routeProvider . when ( '/foo' , { template : 'tpl.html' , controller : MyCtrl } ) ;
442+ $routeProvider . when ( '/foo' , { templateUrl : 'tpl.html' , controller : MyCtrl } ) ;
418443 } ) ;
419444
420445 inject ( function ( $templateCache , $location , $rootScope , $route ) {
0 commit comments