angular/packages/router/src/router_outlet_map.ts
Miško Hevery bc431888f3 fix(router): Update types for TypeScript nullability support
This reverts commit ea8ffc984136ef4d32b6858fe35e69cc9fced021.
2017-04-18 12:07:33 -07:00

30 lines
720 B
TypeScript

/**
* @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
*/
import {RouterOutlet} from './directives/router_outlet';
/**
* @whatItDoes Contains all the router outlets created in a component.
*
* @stable
*/
export class RouterOutletMap {
/** @internal */
_outlets: {[name: string]: RouterOutlet} = {};
/**
* Adds an outlet to this map.
*/
registerOutlet(name: string, outlet: RouterOutlet): void { this._outlets[name] = outlet; }
/**
* Removes an outlet from this map.
*/
removeOutlet(name: string): void { this._outlets[name] = undefined !; }
}