mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
revert: fix($route): update current route upon $route instantiation
This reverts commit 2b344dbd20.
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
This commit is contained in:
parent
2cd09c9f0e
commit
308598795a
2 changed files with 4 additions and 5 deletions
|
|
@ -443,7 +443,6 @@ function $RouteProvider(){
|
|||
}
|
||||
};
|
||||
|
||||
updateRoute();
|
||||
$rootScope.$on('$locationChangeSuccess', updateRoute);
|
||||
|
||||
return $route;
|
||||
|
|
|
|||
|
|
@ -389,7 +389,7 @@ describe('$route', function() {
|
|||
var onChangeSpy = jasmine.createSpy('onChange');
|
||||
|
||||
$rootScope.$on('$routeChangeStart', onChangeSpy);
|
||||
expect($route.current).not.toBeUndefined();
|
||||
expect($route.current).toBeUndefined();
|
||||
expect(onChangeSpy).not.toHaveBeenCalled();
|
||||
|
||||
$location.path('/unknownRoute');
|
||||
|
|
@ -426,7 +426,7 @@ describe('$route', function() {
|
|||
|
||||
// init
|
||||
$rootScope.$on('$routeChangeStart', onChangeSpy);
|
||||
expect($route.current).not.toBeUndefined();
|
||||
expect($route.current).toBeUndefined();
|
||||
expect(onChangeSpy).not.toHaveBeenCalled();
|
||||
|
||||
|
||||
|
|
@ -434,7 +434,7 @@ describe('$route', function() {
|
|||
$location.path('/unknownRoute');
|
||||
$rootScope.$digest();
|
||||
|
||||
expect(currentRoute).not.toBeUndefined();
|
||||
expect(currentRoute).toBeUndefined();
|
||||
expect(nextRoute.templateUrl).toBe('404.html');
|
||||
expect($route.current.templateUrl).toBe('404.html');
|
||||
expect(onChangeSpy).toHaveBeenCalled();
|
||||
|
|
@ -770,7 +770,7 @@ describe('$route', function() {
|
|||
var onChangeSpy = jasmine.createSpy('onChange');
|
||||
|
||||
$rootScope.$on('$routeChangeStart', onChangeSpy);
|
||||
expect($route.current).not.toBeUndefined();
|
||||
expect($route.current).toBeUndefined();
|
||||
expect(onChangeSpy).not.toHaveBeenCalled();
|
||||
|
||||
$location.path('/');
|
||||
|
|
|
|||
Loading…
Reference in a new issue