W3cubDocs

/Angular 2 TypeScript

RouterOutlet

Stable Directive

What it does

Acts as a placeholder that Angular dynamically fills based on the current router state.

How to use

<router-outlet></router-outlet>
<router-outlet name='left'></router-outlet>
<router-outlet name='right'></router-outlet>

A router outlet will emit an activate event any time a new component is being instantiated, and a deactivate event when it is being destroyed.

<router-outlet
  (activate)='onActivate($event)'
  (deactivate)='onDeactivate($event)'></router-outlet>

Class Overview

class RouterOutlet implements OnDestroy {
  constructor(parentOutletMap: RouterOutletMap, location: ViewContainerRef, resolver: ComponentFactoryResolver, name: string)
  
  
  outletMap : RouterOutletMap
  activateEvents : EventEmitter
  deactivateEvents : EventEmitter
  ngOnDestroy() : void
  locationInjector : Injector
  locationFactoryResolver : ComponentFactoryResolver
  isActivated : boolean
  component : Object
  activatedRoute : ActivatedRoute
  detach() : ComponentRef<any>
  attach(ref: ComponentRef<any>, activatedRoute: ActivatedRoute)
  deactivate() : void
  activate(activatedRoute: ActivatedRoute, resolver: ComponentFactoryResolver, injector: Injector, providers: ResolvedReflectiveProvider[], outletMap: RouterOutletMap) : void
}

Selectors

router-outlet

Class Description

Constructor

constructor(parentOutletMap: RouterOutletMap, location: ViewContainerRef, resolver: ComponentFactoryResolver, name: string)

Class Details

outletMap : RouterOutletMap
activateEvents : EventEmitter
deactivateEvents : EventEmitter
ngOnDestroy() : void
locationInjector : Injector
locationFactoryResolver : ComponentFactoryResolver
isActivated : boolean
component : Object
activatedRoute : ActivatedRoute
detach() : ComponentRef<any>
attach(ref: ComponentRef<any>, activatedRoute: ActivatedRoute)
deactivate() : void
activate(activatedRoute: ActivatedRoute, resolver: ComponentFactoryResolver, injector: Injector, providers: ResolvedReflectiveProvider[], outletMap: RouterOutletMap) : void

exported from @angular/router/index, defined in @angular/router/src/directives/router_outlet.ts

© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v2.angular.io/docs/ts/latest/api/router/index/RouterOutlet-directive.html