Skip to content

Commit 8dee8f1

Browse files
author
Matias Niemela
committed
revert: fix(ngRoute): allow ngView to be included in an asynchronously loaded template
This reverts commit 88322c1.
1 parent 1eef631 commit 8dee8f1

File tree

3 files changed

+1
-51
lines changed

3 files changed

+1
-51
lines changed

src/ngRoute/route.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@
1717
*/
1818
/* global -ngRouteModule */
1919
var ngRouteModule = angular.module('ngRoute', ['ng']).
20-
provider('$route', $RouteProvider).
21-
// Ensure `$route` will be instantiated in time to capture the initial
22-
// `$locationChangeSuccess` event. This is necessary in case `ngView` is
23-
// included in an asynchronously loaded template.
24-
run(['$route', angular.noop]),
20+
provider('$route', $RouteProvider),
2521
$routeMinErr = angular.$$minErr('ngRoute');
2622

2723
/**

test/ngRoute/directive/ngViewSpec.js

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -986,34 +986,3 @@ describe('ngView animations', function() {
986986
));
987987
});
988988
});
989-
990-
describe('ngView in async template', function() {
991-
beforeEach(module('ngRoute'));
992-
beforeEach(module(function($compileProvider, $provide, $routeProvider) {
993-
$compileProvider.directive('asyncView', function() {
994-
return {templateUrl: 'async-view.html'};
995-
});
996-
997-
$provide.decorator('$templateRequest', function($timeout) {
998-
return function() {
999-
return $timeout(angular.identity, 500, false, '<ng-view></ng-view>');
1000-
};
1001-
});
1002-
1003-
$routeProvider.when('/', {template: 'Hello, world !'});
1004-
}));
1005-
1006-
1007-
it('should work correctly upon initial page load',
1008-
// Injecting `$location` here is necessary, so that it gets instantiated early
1009-
inject(function($compile, $location, $rootScope, $timeout) {
1010-
var elem = $compile('<async-view></async-view>')($rootScope);
1011-
$rootScope.$digest();
1012-
$timeout.flush(500);
1013-
1014-
expect(elem.text()).toBe('Hello, world !');
1015-
1016-
dealoc(elem);
1017-
})
1018-
);
1019-
});

test/ngRoute/routeSpec.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,6 @@ describe('$route', function() {
2323
dealoc(element);
2424
});
2525

26-
it('should be loaded upon initial load (even if `ngView` is loaded async)', function() {
27-
module(function($routeProvider) {
28-
$routeProvider.when('/', {template: 'Hello, world !'});
29-
});
30-
31-
inject(function($location, $rootScope) {
32-
$location.path('/');
33-
$rootScope.$digest();
34-
});
35-
36-
inject(function($route) {
37-
expect($route.current).toBeDefined();
38-
});
39-
});
40-
4126
it('should allow cancellation via $locationChangeStart via $routeChangeStart', function() {
4227
module(function($routeProvider) {
4328
$routeProvider.when('/Edit', {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy