Created
November 2, 2018 14:16
-
-
Save bob-lee/711bb27e225febd72652da682f59dcca 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
export class LazyLoadDirective implements AfterViewInit, OnDestroy { | |
public ngAfterViewInit() { | |
if (this._service.delayMsec > 0) { // register later | |
const sub = this._service.announcedOrder.pipe(first()).subscribe(_ => this.doRegister()); | |
this._subscription.add(sub); | |
} else { // register now (default) | |
this.doRegister(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment