angular-cn/modules/@angular/router/src/router_outlet_map.ts

30 lines
718 B
TypeScript
Raw Normal View History

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
2016-06-08 14:13:41 -04:00
import {RouterOutlet} from './directives/router_outlet';
2016-05-24 16:21:55 -04:00
/**
* @whatItDoes Contains all the router outlets created in a component.
*
2016-06-28 17:49:29 -04:00
* @stable
*/
2016-05-24 16:21:55 -04:00
export class RouterOutletMap {
/** @internal */
_outlets: {[name: string]: RouterOutlet} = {};
/**
* Adds an outlet to this map.
*/
2016-05-24 16:21:55 -04:00
registerOutlet(name: string, outlet: RouterOutlet): void { this._outlets[name] = outlet; }
/**
* Removes an outlet from this map.
*/
removeOutlet(name: string): void { this._outlets[name] = undefined; }
2016-05-24 16:21:55 -04:00
}