fix(router): disallow component routes with named outlets

Closes #11208, #11082
This commit is contained in:
vsavkin
2016-10-20 15:00:15 -07:00
parent fc60fa790c
commit 8f2fa0f766
3 changed files with 20 additions and 3 deletions

View File

@ -12,8 +12,6 @@ import {RouterOutletMap} from '../router_outlet_map';
import {ActivatedRoute} from '../router_state';
import {PRIMARY_OUTLET} from '../shared';
/**
* @whatItDoes Acts as a placeholder that Angular dynamically fills based on the current router
* state.
@ -79,6 +77,10 @@ export class RouterOutlet implements OnDestroy {
activatedRoute: ActivatedRoute, loadedResolver: ComponentFactoryResolver,
loadedInjector: Injector, providers: ResolvedReflectiveProvider[],
outletMap: RouterOutletMap): void {
if (this.isActivated) {
throw new Error('Cannot activate an already activated outlet');
}
this.outletMap = outletMap;
this._activatedRoute = activatedRoute;