Skip to content

Commit

Permalink
fix(directive): Guard ngOnChnages invokation if not specified by dyna…
Browse files Browse the repository at this point in the history
…mic component
  • Loading branch information
gund committed Mar 25, 2017
1 parent 7613200 commit 51c795b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/dynamic/dynamic.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ export class DynamicDirective implements OnChanges, DoCheck, OnDestroy {
}

notifyOnInputChanges(changes: SimpleChanges = {}, forceFirstChanges: boolean) {
// Exit early if component not interrested to receive changes
if (!this._componentInst.ngOnChanges) {
return;
}

if (forceFirstChanges) {
changes = this._collectFirstChanges();
}
Expand Down

0 comments on commit 51c795b

Please sign in to comment.