Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 3085987

Browse files
committed
revert: fix($route): update current route upon $route instantiation
This reverts commit 2b344db. I think I merged this commit prematurely and in addition to that we found out that it's breaking google apps. Jen Bourey will provide more info at the original PR #5681
1 parent 2cd09c9 commit 3085987

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/ngRoute/route.js

-1
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,6 @@ function $RouteProvider(){
443443
}
444444
};
445445

446-
updateRoute();
447446
$rootScope.$on('$locationChangeSuccess', updateRoute);
448447

449448
return $route;

test/ngRoute/routeSpec.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ describe('$route', function() {
389389
var onChangeSpy = jasmine.createSpy('onChange');
390390

391391
$rootScope.$on('$routeChangeStart', onChangeSpy);
392-
expect($route.current).not.toBeUndefined();
392+
expect($route.current).toBeUndefined();
393393
expect(onChangeSpy).not.toHaveBeenCalled();
394394

395395
$location.path('/unknownRoute');
@@ -426,15 +426,15 @@ describe('$route', function() {
426426

427427
// init
428428
$rootScope.$on('$routeChangeStart', onChangeSpy);
429-
expect($route.current).not.toBeUndefined();
429+
expect($route.current).toBeUndefined();
430430
expect(onChangeSpy).not.toHaveBeenCalled();
431431

432432

433433
// match otherwise route
434434
$location.path('/unknownRoute');
435435
$rootScope.$digest();
436436

437-
expect(currentRoute).not.toBeUndefined();
437+
expect(currentRoute).toBeUndefined();
438438
expect(nextRoute.templateUrl).toBe('404.html');
439439
expect($route.current.templateUrl).toBe('404.html');
440440
expect(onChangeSpy).toHaveBeenCalled();
@@ -770,7 +770,7 @@ describe('$route', function() {
770770
var onChangeSpy = jasmine.createSpy('onChange');
771771

772772
$rootScope.$on('$routeChangeStart', onChangeSpy);
773-
expect($route.current).not.toBeUndefined();
773+
expect($route.current).toBeUndefined();
774774
expect(onChangeSpy).not.toHaveBeenCalled();
775775

776776
$location.path('/');

0 commit comments

Comments
 (0)