Skip to content

Commit bdcc898

Browse files
committed
Merge pull request #43 from dkamburov/top-level-opts
Fix two-way data binding when dataSource is top-level option
2 parents ecabea9 + 3ee2173 commit bdcc898

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/igniteui.angular2.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ export class IgControlBase<Model> implements DoCheck {
104104

105105
@Input() set options(v: Model) {
106106
this._config = jQuery.extend(true, v, this._opts);
107+
if (this._opts.dataSource) {
108+
// _config.dataSource should reference the data if the data is set as a top-level opts
109+
// to allow two-way data binding
110+
this._config.dataSource = this._opts.dataSource;
111+
}
107112
this._differ = this._differs.find([]).create(null);
108113
this._opts = jQuery.extend(true, {}, this._config);
109114
if (this._opts.dataSource) {

0 commit comments

Comments
 (0)