| 81 | _portal!: TemplatePortal; |
| 82 | |
| 83 | ngAfterContentInit() { |
| 84 | this._isSelected = this._stepper.steps.changes |
| 85 | .pipe( |
| 86 | switchMap(() => { |
| 87 | return this._stepper.selectionChange.pipe( |
| 88 | map(event => event.selectedStep === this), |
| 89 | startWith(this._stepper.selected === this), |
| 90 | ); |
| 91 | }), |
| 92 | ) |
| 93 | .subscribe(isSelected => { |
| 94 | if (isSelected && this._lazyContent && !this._portal) { |
| 95 | this._portal = new TemplatePortal(this._lazyContent._template, this._viewContainerRef!); |
| 96 | } |
| 97 | }); |
| 98 | } |
| 99 | |
| 100 | ngOnDestroy() { |
| 101 | this._isSelected.unsubscribe(); |