Skip to content

Instantly share code, notes, and snippets.

@NetanelBasal
Created September 13, 2018 06:08
Show Gist options
  • Save NetanelBasal/53e2af781cd616b686073ca38aaad8be to your computer and use it in GitHub Desktop.
Save NetanelBasal/53e2af781cd616b686073ca38aaad8be to your computer and use it in GitHub Desktop.
function changeInput(inputName, value) {
ng.probe($0).componentInstance[inputName] = value;
ng.probe($0).injector.get(ng.coreTokens.ApplicationRef).tick();
}
function subscribeOutput(outputName, cb) {
const subscription = ng.probe($0).componentInstance[outputName].subscribe((value) => {
console.log(`${outputName} => ${value}`);
});
return () => subscription.unsubscribe();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment