Last active
July 4, 2017 10:24
-
-
Save slavafomin/dc53ae995a449e13807217ae0b582c27 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component() | |
export class SomeComponent implements AfterViewInit { | |
@ViewChild(RouterOutlet) | |
outlet: RouterOutlet; | |
ngAfterViewInit (): void { | |
if (this.outlet.isActivated) { | |
this.doSomethingWithComponent(this.outlet.component); | |
} | |
this.outlet.activateEvents | |
.subscribe(component => this.doSomethingWithComponent(component)) | |
; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment