Skip to content

Commit

Permalink
fix(datalayer): smarter ngOnChanges
Browse files Browse the repository at this point in the history
Fixes #1099
  • Loading branch information
IlianSchokkaert authored and sebholstein committed Oct 7, 2017
1 parent 33eea1c commit 91cff2a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/core/directives/data-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ export class AgmDataLayer implements OnInit, OnDestroy, OnChanges {
}

let dataOptions: DataOptions = {};
const optionKeys = Object.keys(changes).filter(
k => AgmDataLayer._dataOptionsAttributes.indexOf(k) !== -1);
optionKeys.forEach(k => (<any>dataOptions)[k] = changes[k].currentValue);

AgmDataLayer._dataOptionsAttributes.forEach(k => (<any>dataOptions)[k] = changes.hasOwnProperty(k) ? changes[k].currentValue : (<any>this)[k]);

this._manager.setDataOptions(this, dataOptions);
}
}

0 comments on commit 91cff2a

Please sign in to comment.