mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
refactor($route): remove .parent(); ng:view scope creation
This commit is contained in:
@@ -633,6 +633,18 @@ describe('widget', function() {
|
||||
}));
|
||||
|
||||
|
||||
it('should create controller instance on $afterRouteChange event', inject(
|
||||
function($route, $rootScope) {
|
||||
var controllerScope;
|
||||
$route.current = { controller: function($scope) { controllerScope = $scope; } };
|
||||
$rootScope.$broadcast('$afterRouteChange', $route.current);
|
||||
|
||||
expect(controllerScope.$parent.$id).toBe($rootScope.$id);
|
||||
expect(controllerScope.$id).toBe($route.current.scope.$id);
|
||||
}
|
||||
));
|
||||
|
||||
|
||||
it('should load content via xhr when route changes', function() {
|
||||
module(function($routeProvider) {
|
||||
$routeProvider.when('/foo', {template: 'myUrl1'});
|
||||
|
||||
Reference in New Issue
Block a user