diff --git a/modules/angular1_router/test/integration/router_spec.js b/modules/angular1_router/test/integration/router_spec.js index bea802f366..00a2385fc4 100644 --- a/modules/angular1_router/test/integration/router_spec.js +++ b/modules/angular1_router/test/integration/router_spec.js @@ -44,7 +44,6 @@ describe('router', function () { expect(elt.text()).toBe('Home'); })); - it('should bind the component to the current router', inject(function($location) { var router; registerComponent('homeCmp', { @@ -74,6 +73,28 @@ describe('router', function () { expect(router).toBeDefined(); })); + it('should work when an async route is provided route data', inject(function($location, $q) { + registerDirective('homeCmp', { + template: 'Home ({{homeCmp.isAdmin}})', + $routerOnActivate: function(next, prev) { + this.isAdmin = next.routeData.data.isAdmin; + } + }); + + registerDirective('app', { + template: '
', + $routeConfig: [ + { path: '/', loader: function() { return $q.when('homeCmp'); }, data: { isAdmin: true } } + ] + }); + + compile('