Skip to content

Commit

Permalink
test(directive): Improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
gund committed Feb 18, 2017
1 parent 435e3dd commit 16ff8f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/dynamic/dynamic.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,12 @@ export class DynamicDirective implements OnChanges, DoCheck, OnDestroy {
.subscribe(this.ndcDynamicOutputs[p]));
}

notifyOnInputChanges(changes: SimpleChanges, forceFirstChanges: boolean) {
notifyOnInputChanges(changes: SimpleChanges = {}, forceFirstChanges: boolean) {
if (forceFirstChanges) {
changes = this._collectFirstChanges();
}

if (changes && this._componentInst) {
this._componentInst.ngOnChanges(changes);
}
this._componentInst.ngOnChanges(changes);
}

private _collectFirstChanges(): SimpleChanges {
Expand Down
2 changes: 1 addition & 1 deletion src/test/component-injector.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComponentInjector } from '../dynamic';
import { Component, ComponentRef, EventEmitter } from '@angular/core';
import { Component, ComponentRef, EventEmitter, Input } from '@angular/core';

@Component({
selector: 'component-injector',
Expand Down

0 comments on commit 16ff8f1

Please sign in to comment.