Skip to content

Instantly share code, notes, and snippets.

@NetanelBasal
Last active November 17, 2018 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NetanelBasal/1e0a38df7da041d5c3529dbb3bdf9e57 to your computer and use it in GitHub Desktop.
Save NetanelBasal/1e0a38df7da041d5c3529dbb3bdf9e57 to your computer and use it in GitHub Desktop.
import { untilDestroyed } from 'ngx-take-until-destroy';
ngOnInit() {
const factory = this.fr.resolveComponentFactory(HelloComponent);
const ref = this.ref.createComponent(factory);
ref.instance.name = 'World';
ref.instance.someOutput.pipe(untilDestroyed(this)).subscribe(...) <======
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment