From e642025b54e04065062d5c49abc1e9f040c22f92 Mon Sep 17 00:00:00 2001 From: Lukasz Potapczuk Date: Wed, 10 Aug 2016 10:10:03 +0200 Subject: [PATCH] Fixed the bug where children of an object weren't passed to the constructor of the SelectItem. --- components/select/select.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/select/select.ts b/components/select/select.ts index 76d9ec17..1d6235ce 100755 --- a/components/select/select.ts +++ b/components/select/select.ts @@ -192,6 +192,7 @@ export class SelectComponent implements OnInit { @Input() public placeholder:string = ''; @Input() public idField:string = 'id'; @Input() public textField:string = 'text'; + @Input() public childrenField:string = 'children'; @Input() public multiple:boolean = false; @Input() @@ -204,7 +205,7 @@ export class SelectComponent implements OnInit { return item; } }); - this.itemObjects = this._items.map((item:any) => (typeof item === 'string' ? new SelectItem(item) : new SelectItem({id: item[this.idField], text: item[this.textField]}))); + this.itemObjects = this._items.map((item:any) => (typeof item === 'string' ? new SelectItem(item) : new SelectItem({id: item[this.idField], text: item[this.textField], children: item[this.childrenField]}))); } }