Skip to content

Commit

Permalink
fix(host): don't override component inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
NetanelBasal committed Jun 26, 2018
1 parent 4c67d43 commit 814e0b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/src/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,15 @@ export function createHostComponentFactory<C, H = HostComponent>(options: Specta
spectatorWithHost.element = spectatorWithHost.debugElement.nativeElement;
}

if (detectChanges) {
spectatorWithHost.hostFixture.detectChanges();
}

if (initialInputs) {
spectatorWithHost.setInput(initialInputs);
}

if (detectChanges) {
spectatorWithHost.hostFixture.detectChanges();
/** Detect changes on the component - useful for onPushComponents */
spectatorWithHost.detectComponentChanges();
}
Expand Down

0 comments on commit 814e0b0

Please sign in to comment.